summary refs log tree commit diff
path: root/synapse/storage/push_rule.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2016-01-27 10:24:20 +0000
committerMark Haines <mark.haines@matrix.org>2016-01-27 10:24:20 +0000
commit8c94833b72f27d18a57e424a0f4f0c823c3a0aa1 (patch)
tree7178d5df739d7d9a8171e12a0578bc9a0037199d /synapse/storage/push_rule.py
parentMerge pull request #528 from matrix-org/markjh/missing_yield (diff)
downloadsynapse-8c94833b72f27d18a57e424a0f4f0c823c3a0aa1.tar.xz
Fix adding push rules relative to other rules
Diffstat (limited to 'synapse/storage/push_rule.py')
-rw-r--r--synapse/storage/push_rule.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/storage/push_rule.py b/synapse/storage/push_rule.py
index 1f51c90ee5..f9a48171ba 100644
--- a/synapse/storage/push_rule.py
+++ b/synapse/storage/push_rule.py
@@ -130,7 +130,8 @@ class PushRuleStore(SQLBaseStore):
 
     def _add_push_rule_relative_txn(self, txn, user_id, **kwargs):
         after = kwargs.pop("after", None)
-        relative_to_rule = kwargs.pop("before", after)
+        before = kwargs.pop("before", None)
+        relative_to_rule = before or after
 
         res = self._simple_select_one_txn(
             txn,