Change display of cancelled users, fix edit link

It’s confusing showing green ticks for cancelled invites. This commit
changes the appearance so that only pending or active users (ie those
that could actually do some damage) get green ticks.

Also fixes missing edit links caused by instances of `User` having
`.state` but instances of `InvitedUser` having `.status`.

Right now these are two separate lists. Which makes it harder to add
improvements that will make large numbers of users easier to manage.
This commit is contained in:
Chris Hill-Scott
2018-01-26 17:14:00 +00:00
parent 6fcb2dfde7
commit 2221a8ca48
3 changed files with 52 additions and 14 deletions

View File

@@ -184,6 +184,8 @@ class InvitedUser(object):
self.auth_type = auth_type
def has_permissions(self, *permissions):
if self.status == 'cancelled':
return False
return set(self.permissions) > set(permissions)
def __eq__(self, other):