mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-25 08:44:23 -04:00
Ensure non-gov invited users get added to services
We were adding invited users to services in the `main.add_service` view function as the last step in the process of inviting users. Since this view function is decorated with `@user_is_gov_user`, invited users with non-governmental email addresses would never reach this point and would be able to register an account but would not get linked to a service. To fix this, we now add the invited user to the service at the point at which the user gets activated and also ensure that non-gov users don't get redirected to a page which they don't have permission to view.
This commit is contained in:
@@ -68,7 +68,6 @@ def register_from_org_invite():
|
||||
abort(400)
|
||||
_do_registration(form, send_email=False, send_sms=True, organisation_id=invited_org_user['organisation'])
|
||||
org_invite_api_client.accept_invite(invited_org_user['organisation'], invited_org_user['id'])
|
||||
user_api_client.add_user_to_organisation(invited_org_user['organisation'], session['user_details']['id'])
|
||||
|
||||
return redirect(url_for('main.verify'))
|
||||
return render_template('views/register-from-org-invite.html', invited_org_user=invited_org_user, form=form)
|
||||
|
||||
Reference in New Issue
Block a user