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

Exception when editing a user to not be a member of the current roster anymore. #292

Closed
werebus opened this issue Aug 14, 2023 · 0 comments · Fixed by #313
Closed

Exception when editing a user to not be a member of the current roster anymore. #292

werebus opened this issue Aug 14, 2023 · 0 comments · Fixed by #313
Labels

Comments

@werebus
Copy link
Member

werebus commented Aug 14, 2023

If you're editing a user from the "Roster A" route (e.g. if Roster A has an id of 1, '/rosters/1/users/5). And you don't include "Roster A" in the list of selected rosters, then you get an exception here:

membership = @user.membership_in @roster
return true if membership.update membership_params

Because, at that point, the user has already been updated to not be in that roster anymore, so @user.membership_in @roster is nil

Note that the intended action — removing the user from "Roster A" — is successful in this case. But the user gets a 500.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants