From 2526b79ce6923bcf681ecd846b718269833e5a7e Mon Sep 17 00:00:00 2001 From: Brendan Abolivier Date: Thu, 25 Jul 2019 10:15:44 +0200 Subject: Merge ifs --- synapse/third_party_rules/access_rules.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'synapse') diff --git a/synapse/third_party_rules/access_rules.py b/synapse/third_party_rules/access_rules.py index 07b449ab32..c37737ea60 100644 --- a/synapse/third_party_rules/access_rules.py +++ b/synapse/third_party_rules/access_rules.py @@ -128,12 +128,11 @@ class RoomAccessRules(object): # rule, the access rule must be "restricted"). We don't need to check that if # there's no access rule provided, as in this case the access rule will # default to "restricted", with which any join rule is allowed. - if join_rule == JoinRules.PUBLIC and access_rule != ACCESS_RULE_RESTRICTED: - raise SynapseError(400, "Invalid access rule") - if ( - preset == RoomCreationPreset.PUBLIC_CHAT - and access_rule != ACCESS_RULE_RESTRICTED + ( + join_rule == JoinRules.PUBLIC + or preset == RoomCreationPreset.PUBLIC_CHAT + ) and access_rule != ACCESS_RULE_RESTRICTED ): raise SynapseError(400, "Invalid access rule") else: -- cgit 1.5.1