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

NoReverseMatch in guardian admin when user model as pk UUID #611

Open
sdementen opened this issue May 11, 2019 · 9 comments
Open

NoReverseMatch in guardian admin when user model as pk UUID #611

sdementen opened this issue May 11, 2019 · 9 comments

Comments

@sdementen
Copy link

sdementen commented May 11, 2019

I have a customer user model where the key is a UUID.
When I want to manage a user permission in the guardian admin model, I get an exception

NoReverseMatch at /admin/app_name/model_name/c7408bd6-1221-434b-a4cf-7611812741d3/permissions/
Reverse for 'app_name_model_name_permissions_manage_user' with arguments '(UUID('c7408bd6-1221-434b-a4cf-7611812741d3'), UUID('307bcb8c-aa25-4c2c-96d2-b466ce7b9b71'))' not found. 1 pattern(s) tried: ['admin/app_name/model_name/(?P<object_pk>.+)/permissions/user-manage/(?P<user_id>\\-?\\d+)/$']

as my user_id is not matching the regexp.
Replacing the regexp by .+ (same as for object_pk) in https://github.com/django-guardian/django-guardian/blob/devel/guardian/admin.py#L99 solve the issues

@ad-m
Copy link
Member

ad-m commented May 11, 2019

Could provide feedback for PR #599?

@sdementen
Copy link
Author

Indeed, same issue/fix.
What kind of feedback is needed to merge or #599?

@ad-m
Copy link
Member

ad-m commented May 14, 2019

Do you notice any issues in your environment after apply proposed patch?

@sdementen
Copy link
Author

No, everything works as expected with the patch

@sdementen
Copy link
Author

any news on this issue ?

@bellini666
Copy link

I'm also having that issue when using uuid for my user.

@lm-sousa
Copy link

Same.
Is there any indication that this pull request will be merged in time for the next release?

@ad-m
Copy link
Member

ad-m commented Sep 11, 2019

Fixed by #634. Released.

@Sleepy105, @bellini666 , @sdementen Could you verify or provide any feedback?

@lm-sousa
Copy link

@ad-m I've installed the current version on the devel branch (#226fb8f) and it fixes the issue.

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

No branches or pull requests

4 participants