-
-
Notifications
You must be signed in to change notification settings - Fork 504
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
Resolves a bug(500 error) when re-using previous partner email #3955
Resolves a bug(500 error) when re-using previous partner email #3955
Conversation
7cdfad6
to
98611db
Compare
app/models/partner.rb
Outdated
@@ -235,6 +235,10 @@ def invite_new_partner | |||
end | |||
|
|||
def should_invite_because_email_changed? | |||
email_changed? and (invited? or awaiting_review? or recertification_required? or approved?) | |||
email_changed? and (invited? or awaiting_review? or recertification_required? or approved?) and !partner_user_with_same_email_exist? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why this was previously implemented with and
/or
instead of &&
/||
, but it might be worth changing it to &&
/||
since we're in here anyway
98611db
to
da25380
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks!
@all-contributors add @patelkrunal31 for coding |
We had trouble processing your request. Please try again later. |
@all-contributors add @patelkrunal31 for coding |
We had trouble processing your request. Please try again later. |
@all-contributors add @patelkrunal31 for code |
We had trouble processing your request. Please try again later. |
@all-contributors add @patelkrunal31 for code |
We had trouble processing your request. Please try again later. |
@patelkrunal31: Your PR |
@all-contributors add @patelkrunal31 for code |
We had trouble processing your request. Please try again later. |
Resolves #3886
Description
When a partner user updates their email address, there is a before_update hook where we invite users based on certain conditions.
While inviting users, we usually throw an error if updating roles for existing users with already assigned roles.
I have updated the hook to also check that the partner user doesn't exist with a similar email and role before inviting.
Type of change
How Has This Been Tested?
I performed tests using local deployment and also using a unit test.
Screenshots