Skip to content

Commit b124deb

Browse files
committed
fix mails import for merge and add assert
1 parent 901e6b2 commit b124deb

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

admin_tests/users/test_views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def test_correct_view_permissions(self):
105105
response = views.ResetPasswordView.as_view()(request, guid=guid)
106106

107107
assert len(notifications['emits']) == 1
108-
assert notifications['emits'][0]['type'] == NotificationType.Type.USER_PASSWORD_RESET
108+
assert notifications['emits'][0]['type'] == NotificationType.Type.USER_FORGOT_PASSWORD
109109
self.assertEqual(response.status_code, 302)
110110

111111

api/users/services.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ def send_password_reset_email(user, email, verification_type='password', institu
1515
user.save()
1616

1717
reset_link = furl(settings.DOMAIN).add(path=f'resetpassword/{user._id}/{user.verification_key_v2["token"]}').url
18+
notification_type = NotificationType.Type.USER_FORGOT_PASSWORD_INSTITUTION if institutional \
19+
else NotificationType.Type.USER_FORGOT_PASSWORD
1820

19-
NotificationType.Type.USER_FORGOT_PASSWORD.instance.emit(
21+
notification_type.instance.emit(
2022
destination_address=email,
2123
event_context={
2224
'reset_link': reset_link,

0 commit comments

Comments
 (0)