explicitely convert is_accepted to boolean
All checks were successful
Tests / test (push) Successful in 31s
All checks were successful
Tests / test (push) Successful in 31s
The is_accepted property returns self.accepted_by or self.accepted_at. When accepted_by is a User object (not None), it returns the User object instead of a boolean. The Django admin's boolean field renderer expects a boolean value (True, False, or None), not a User object.
This commit is contained in:
parent
014e88aa24
commit
54998ab9d0
1 changed files with 1 additions and 1 deletions
|
|
@ -485,7 +485,7 @@ class OrganizationInvitation(ServalaModelMixin, models.Model):
|
|||
def is_accepted(self):
|
||||
# We check both accepted_by and accepted_at to avoid a deleted user
|
||||
# freeing up an invitation
|
||||
return self.accepted_by or self.accepted_at
|
||||
return bool(self.accepted_by or self.accepted_at)
|
||||
|
||||
@property
|
||||
def can_be_accepted(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue