fix invitations of new users when mail is disabled #2773
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While testing locally (where I don't have mail enabled) I noticed that inviting a new user will save them as invited. Removing and inviting the same user again (or inviting them in a second organization) they will be listed as accepted instead. This should not happen, because until the user has actually created an account they cannot be confirmed yet (and without admin panel access you would not know when they have done so).
If you try to confirm an
invitedaccepted but non-existing user you will be greeted with this error message:(The error happens client side so there are no relevant server logs.)
Since registering an account automatically accepts the outstanding invitations for a user anyway, setting UserOrgStatus::Accepted can be limited to already registered users (when mail is disabled).