Skip to content
This repository has been archived by the owner on Dec 6, 2021. It is now read-only.

fix __eq__ caused error when delete a user in admin dashboard #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion userroles/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ def profile(self):
return getattr(self, self.child)

def __eq__(self, other):
return self.name == other.name
other_name = getattr(other, "name", "")
return self.name == other_name

def __getattr__(self, name):
if name.startswith('is_'):
Expand Down