Fix type information on assert_*_is_admin methods (#7645)

These things don't return Deferreds.
This commit is contained in:
Richard van der Hoff 2020-06-05 14:33:49 +01:00 committed by GitHub
parent b4f8dcb4bd
commit eea124370b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 23 deletions

View file

@ -510,16 +510,16 @@ class Auth(object):
request.authenticated_entity = service.sender
return defer.succeed(service)
def is_server_admin(self, user):
async def is_server_admin(self, user: UserID) -> bool:
""" Check if the given user is a local server admin.
Args:
user (UserID): user to check
user: user to check
Returns:
bool: True if the user is an admin
True if the user is an admin
"""
return self.store.is_server_admin(user)
return await self.store.is_server_admin(user)
def compute_auth_events(
self, event, current_state_ids: StateMap[str], for_verification: bool = False,