-
Notifications
You must be signed in to change notification settings - Fork 38
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
Error when deleting a role from the Admin site #60
Comments
I think I need more of a stack trace to troubleshoot.
Looks like the same error fixed by #61 —is this a duplicate? |
My bad on the issue reporting- I'll edit the original issue because I had a copy/paste error (now wonder why you thought it was a duplicate). Sorry about that. Here is the actual trace and not the copy from debug=True from the browser:
|
Thanks @stgraham2000. Do you know if it is a new requirement with Django 3 that model classes must be hashable to support delete via admin interface? In other words, I wonder if this ever worked? |
@millerdev, I just ran a simple test with 2.2.15 and I can delete roles. So to answer your question, it looks like it is a django 3+ issue. That said, another issue which we should probably raise is you can't add a new role in the admin if you leave the parameters blank. I'll quickly submit that issue as well with trace. |
I've discovered the same.
The solution would of course be, just to add a def patch_hash(cls):
__class__ = cls
def hash(self):
return super().__hash__()
cls.__hash__ = hash
patch_hash(UserRole) |
One more thing that I discovered when using Django built in collector for cascade deletion. There should be a check in |
If you try to delete a role from the admin interface on Django 3.0.9 you get:
The text was updated successfully, but these errors were encountered: