Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling invite a deactivated user #35144

Merged
merged 4 commits into from
Sep 19, 2024

Conversation

jingcheng16
Copy link
Contributor

@jingcheng16 jingcheng16 commented Sep 18, 2024

Product Description

image

One of our customer thought, by invite an deactivated user who is already a member of the domain with a new role, the new role will overwrite the old role, which is not the case. Theoretically you should not invite someone who is already a member again.
So I decide to disable invitation for deactivated user. This is discussed and approved in product meeting.

Technical Summary

Ticket: https://dimagi.atlassian.net/browse/SAAS-15997

Safety Assurance

Safety story

Tested locally. The change is very straightforward.

Automated test coverage

QA Plan

No QA

Rollback instructions

  • This PR can be reverted after deploy with no further considerations

Labels & Review

  • Risk label is set correctly
  • The set of people pinged as reviewers is appropriate for the level of risk of the change

@dimagimon dimagimon added the Risk: High Change affects files that have been flagged as high risk. label Sep 18, 2024
@jingcheng16 jingcheng16 added the product/all-users-all-environments Change impacts all users on all environments label Sep 18, 2024
web_user = WebUser.get_by_username(email)
if web_user and not web_user.is_active:
raise forms.ValidationError(_("A user with this email address is deactivated. "
"Please reactivate this user first."))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not blocking: it'd be a nice UX improvement to turn "reactivate this user" into a link to the edit page for the relevant web user. (Granted, then you have to make sure whatever code catches this error ultimately displays it as HTML.)

Copy link
Contributor Author

@jingcheng16 jingcheng16 Sep 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Jenny. Usually we don't deactivate user, deactivation and reactivation can be operated by us in Admin>Look up user by email. So having that link might not be very helpful for most customers, because they won't have access to that tool. For SSO user who get auto-deactivated, they need first add the user back to their identity provider, then ask the user to relogin, I feel this is too long in a error message?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. If most users won't have access, perhaps we shouldn't tell them to reactivate the user? We have other messages that say to contact support (if that's the appropriate action), or maybe just removing the second sentence would be fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, removed in 409c134 ...

@jingcheng16 jingcheng16 marked this pull request as ready for review September 18, 2024 22:31
Most user won't know how to reactivate a user, so it is not helpful.
@jingcheng16 jingcheng16 merged commit 7fb17e3 into master Sep 19, 2024
13 checks passed
@jingcheng16 jingcheng16 deleted the jc/disable-inviting-deactivated-user branch September 19, 2024 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product/all-users-all-environments Change impacts all users on all environments Risk: High Change affects files that have been flagged as high risk.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants