models: Add assert statement for full_members policy in has_permission.

This commit adds an assert statement in the last block of
has_permission which checks whether the policy_value is
POLICY_FULL_MEMBERS_ONLY. This assert statement is added
for readability.
This commit is contained in:
sahil839 2021-03-30 20:22:21 +05:30 committed by Tim Abbott
parent fe27fe5555
commit 911854d0bf
1 changed files with 2 additions and 0 deletions

View File

@ -1454,6 +1454,8 @@ class UserProfile(AbstractBaseUser, PermissionsMixin):
if policy_value == Realm.POLICY_MEMBERS_ONLY:
return True
assert policy_value == Realm.POLICY_FULL_MEMBERS_ONLY
return not self.is_provisional_member
def can_create_streams(self) -> bool: