mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-28 22:30:44 -05:00
Don’t implement separate __getitem__ for invited users
It can inherit now because both `User.__init__` and `InvitedUser.__init__` have the same method signature.
This commit is contained in:
@@ -528,12 +528,13 @@ class AnonymousUser(AnonymousUserMixin):
|
||||
class Users(Sequence):
|
||||
|
||||
client = user_api_client.get_users_for_service
|
||||
model = User
|
||||
|
||||
def __init__(self, service_id):
|
||||
self.users = self.client(service_id)
|
||||
|
||||
def __getitem__(self, index):
|
||||
return User(self.users[index])
|
||||
return self.model(self.users[index])
|
||||
|
||||
def __len__(self):
|
||||
return len(self.users)
|
||||
@@ -557,9 +558,6 @@ class InvitedUsers(Users):
|
||||
if user['status'] != 'accepted'
|
||||
]
|
||||
|
||||
def __getitem__(self, index):
|
||||
return self.model(self.users[index])
|
||||
|
||||
|
||||
class OrganisationInvitedUsers(InvitedUsers):
|
||||
client = org_invite_api_client.get_invites_for_organisation
|
||||
|
||||
Reference in New Issue
Block a user