code4romania / sunrise

Mozilla Public License 2.0
0 stars 1 forks source link

500 Internal Server Error When Attempting to Create an Existing Staff Account in a Different Center #287

Open andrei-manda opened 5 days ago

andrei-manda commented 5 days ago

Description

A 500 Internal Server Error occurs when attempting to create a staff account that already exists in the system to a different center. (based on the email)

teodoranegru commented 5 days ago

Exected behaviour:

Suppose the NGO Admin adds a new user to a center but that user already exists (an account is already created with that email address) in another center. In that case, the account should be created following the steps below:

  1. NGO Admin adds the user in the Staff section
  2. The system checks if there are any other accounts associated with that email address in the db (all centers from all institutions) If YES:
  3. The system: 3.1. Adds the account in that center's users list 3.2. Sends an invitation email to the email address (see design here)
  4. The user receives the invitation email and clicks on the "Acceptă invitația" button
  5. The system retrieves the Log in screen
  6. The user enters their account credentials
  7. The system retrieves the interface of the center to which the user has just been added to Note: The user will be able to see all centers they are part of and navigate between them using the tenant switcher, similar to how the NGO Admin navigates between the institution's centers