Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replace username with full name in attemp emails #250

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

ahtesham-quraish
Copy link
Contributor

@ahtesham-quraish ahtesham-quraish commented Feb 22, 2024

JIRA:
VAN-1833

Description:
Remove username and change subject in attempts emails

Testing instructions:
It has been tested locally

Before After
image image
image image

Copy link
Member

@rijuma rijuma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -44,12 +44,13 @@ def send_attempt_status_email(attempt, escalation_email=None):
contact_url = f'{settings.LMS_ROOT_URL}/support/contact_us'
contact_url_text = contact_url

email_subject = f'Proctored exam {exam.exam_name} for user {attempt.user.username}'
email_subject = f'Proctored exam {exam.exam_name} for user {attempt.user.full_name}'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK this IDA isn't populating full_name when it creates new User objects since up until this point there's been no use for it. I think you'll need to ensure that happens and possibly migrate that value into existing users.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you share how data is populated in this IDA?

Copy link
Contributor

@zacharis278 zacharis278 Feb 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not exactly sure, it's part of the cookie cutter installation for all IDAs. I think it's baked into JWT authentication within https://github.com/openedx/edx-drf-extensions somehow. Although, I imagine this could be an issue for all other IDAs as well depending on if the particular bit of code is looking at JWT details vs the User object from the database. Names should be on the JWT but doesn't seem to always exist in the User model.

@ahtesham-quraish ahtesham-quraish force-pushed the ahtesham/1833 branch 3 times, most recently from e46f853 to aafadce Compare March 7, 2024 08:30
Copy link
Member

@MichaelRoytman MichaelRoytman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. Could you please update the commit message and pull request title to accurately reflect the changes, since we are not longer replacing the username with the full name?

@ahtesham-quraish
Copy link
Contributor Author

This looks good. Could you please update the commit message and pull request title to accurately reflect the changes, since we are not longer replacing the username with the full name?

I made the change now

Description:
Remove username and change the subject of emails
VAN-1833
@@ -44,7 +47,6 @@ def send_attempt_status_email(attempt, escalation_email=None):
contact_url = f'{settings.LMS_ROOT_URL}/support/contact_us'
contact_url_text = contact_url

email_subject = f'Proctored exam {exam.exam_name} for user {attempt.user.username}'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can we not leave the exam name in?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually we have discussed subject line with UX team and they suggested us that we can remove the exam name from subject but if you still think we should get it back we can then discuss with UX again. Thanks

@ahtesham-quraish ahtesham-quraish dismissed zacharis278’s stale review March 19, 2024 05:41

We already got 3 approval so no need to get any another

@ahtesham-quraish ahtesham-quraish merged commit 0275ddc into main Mar 19, 2024
8 checks passed
@ahtesham-quraish ahtesham-quraish deleted the ahtesham/1833 branch March 19, 2024 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants