2 files changed, 8 insertions, 5 deletions
diff --git a/synapse/push/baserules.py b/synapse/push/baserules.py
index 792af70eb7..6add94beeb 100644
--- a/synapse/push/baserules.py
+++ b/synapse/push/baserules.py
@@ -19,9 +19,11 @@ import copy
def list_with_base_rules(rawrules):
"""Combine the list of rules set by the user with the default push rules
- :param list rawrules: The rules the user has modified or set.
- :returns: A new list with the rules set by the user combined with the
- defaults.
+ Args:
+ rawrules(list): The rules the user has modified or set.
+
+ Returns:
+ A new list with the rules set by the user combined with the defaults.
"""
ruleslist = []
diff --git a/synapse/push/push_rule_evaluator.py b/synapse/push/push_rule_evaluator.py
index 51f73a5b78..c3c2877629 100644
--- a/synapse/push/push_rule_evaluator.py
+++ b/synapse/push/push_rule_evaluator.py
@@ -133,8 +133,9 @@ class PushRuleEvaluator:
enabled = self.enabled_map.get(r['rule_id'], None)
if enabled is not None and not enabled:
continue
-
- if not r.get("enabled", True):
+ elif enabled is None and not r.get("enabled", True):
+ # if no override, check enabled on the rule itself
+ # (may have come from a base rule)
continue
conditions = r['conditions']
|