From 911854d0bf11b73d3c8b4252104cb5cda6b8405d Mon Sep 17 00:00:00 2001 From: sahil839 Date: Tue, 30 Mar 2021 20:22:21 +0530 Subject: [PATCH] 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. --- zerver/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zerver/models.py b/zerver/models.py index 548ee8962b..0a4d5ccc3a 100644 --- a/zerver/models.py +++ b/zerver/models.py @@ -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: