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

Use user.id instead of user in the path for the "Remove User" delete … #32

Merged

Conversation

coblej
Copy link

@coblej coblej commented May 8, 2018

…action; addresses #21.

As currently coded, the path for the "Remove User" delete method does not use the ID of the user who is to removed from the role but rather what I presume is the user's user_key, which, if it has the form of an email address, is converted to something of an "escaped" version ... e.g., "user_a@institution-dot-edu". When the code tries to find the user (cf. https://github.com/samvera/hydra-role-management/blob/master/app/controllers/concerns/hydra/role_management/user_roles_behavior.rb#L24 ) in performing the deletion, it is unable to and an ActiveRecord::RecordNotFound error is thrown:

ActiveRecord::RecordNotFound (Couldn't find User with 'id'=user_@institution-dot-edu)

This PR fixes this problem by utilizing the work-around noted by @awead in #21 (comment) by which the path for the delete method is formulated using the id of the user; e.g., http://localhost:3000/roles/3/users/1.

@jrgriffiniii jrgriffiniii self-requested a review May 8, 2018 20:33
@coveralls
Copy link

Coverage Status

Coverage remained the same at 98.66% when pulling 6c79cd1 on coblej:21-remove-user-from-role-problem into 1c389c7 on samvera:master.

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

Successfully merging this pull request may close these issues.

3 participants