Fixed the signature in the email sent when the review request is closed by admin

Review Request #12029 — Created Feb. 3, 2022 and updated

sheenaNg
Review Board
release-4.0.x
reviewboard

Currently, when users with admin rights close the review request,
the email template shows the wrong name in the signature at the
bottom of the e-mail content.

This change involves replacing the review_request.submitter
with user to display the name of the admin / user that
closed the review request instead of the owner of the
review request.

Added unit test to test_sending_email.py

I have also included the screenshots that show the changes:

  1. This screenshot shows the TXT e-mail that is created when
    I re-opened the review request and published it. My name is
    in the signature of the e-email.

  2. This screenshot shows the TXT e-mail that is created when
    a user with admin rights closed the review request (discarded).
    The name of the user with admin rights (superUser Admin) is
    in the signature of the e-mail.

Summary Author
Fixed the signature in the email sent when the review request is closed by admin
sng06
Changed the review_request.submitter variable to user
sng06
Reverted changes in html file and changed the signature variable to user
sng06
Reverted changes in html template as we want to preserve the author in the By field
sng06
Added unit test to test changes of close email after fixing the signature
sng06
Made changes to codes according to code review feedback received
sng06

Description From Last Updated

I know some of the other things in here say "Tests", but all test docstrings should start with "Testing"

daviddavid

May be a minor thing, but you can shorten this, by including publish=True inside the self.create_review_request function.

gdehalgdehal

These can be self.assertIn('...', message.as_string()), which I think will give us better debug output if they fail.

daviddavid
sheenaNg
sheenaNg
sheenaNg
sheenaNg
sheenaNg
sheenaNg
gdehal
  1. 
      
  2. May be a minor thing, but you can shorten this, by including publish=True inside the self.create_review_request function.

  3. 
      
david
  1. 
      
  2. I know some of the other things in here say "Tests", but all test docstrings should start with "Testing"

  3. These can be self.assertIn('...', message.as_string()), which I think will give us better debug output if they fail.

  4. 
      
sheenaNg
Review request changed

Change Summary:

Made changes to codes based on code review feedback

Commits:

Summary Author
-
Fixed the signature in the email sent when the review request is closed by admin
sng06
-
Changed the review_request.submitter variable to user
sng06
-
Reverted changes in html file and changed the signature variable to user
sng06
-
Reverted changes in html template as we want to preserve the author in the By field
sng06
-
Added unit test to test changes of close email after fixing the signature
sng06
+
Fixed the signature in the email sent when the review request is closed by admin
sng06
+
Changed the review_request.submitter variable to user
sng06
+
Reverted changes in html file and changed the signature variable to user
sng06
+
Reverted changes in html template as we want to preserve the author in the By field
sng06
+
Added unit test to test changes of close email after fixing the signature
sng06
+
Made changes to codes according to code review feedback received
sng06

Diff:

Revision 5 (+345 -283)

Show changes

Checks run (2 succeeded)

flake8 passed.
JSHint passed.
Loading...