mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-02 17:48:50 -04:00
After investigating a 500 in the admin app, I found an edge case in the invitation registration flow that can cause an error.
The flow is as follows: If the invited user clicks on the /invitation/<token> link in the email (now on /register-from-invite), then goes to another browser and registers for Notify. Coming back to the other browser, submit the form for /register-from-invite. This PR fixes that bug and adds a couple tests for register_from_invite
This commit is contained in:
@@ -80,8 +80,8 @@ def _do_registration(form, service=None, send_sms=True, send_email=True):
|
||||
session['expiry_date'] = str(datetime.utcnow() + timedelta(hours=1))
|
||||
session['user_details'] = {"email": user.email_address, "id": user.id}
|
||||
else:
|
||||
user = user_api_client.get_user_by_email(form.email_address.data)
|
||||
if send_email:
|
||||
user = user_api_client.get_user_by_email(form.email_address.data)
|
||||
user_api_client.send_already_registered_email(user.id, user.email_address)
|
||||
session['expiry_date'] = str(datetime.utcnow() + timedelta(hours=1))
|
||||
session['user_details'] = {"email": user.email_address, "id": user.id}
|
||||
|
||||
Reference in New Issue
Block a user