mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-06-22 14:11:27 -04:00
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.