summary refs log tree commit diff
path: root/synapse/push/__init__.py
diff options
context:
space:
mode:
authorMark Haines <mjark@negativecurvature.net>2015-05-26 10:40:50 +0100
committerMark Haines <mjark@negativecurvature.net>2015-05-26 10:40:50 +0100
commite7b25a649cac1491124fcac80306517238e4de05 (patch)
treec3b45907093240dc12768c157cb9527b8bb63c4e /synapse/push/__init__.py
parentMerge pull request #165 from matrix-org/bugs/SYN-390 (diff)
parentSYN-390: Don't modify the dictionary returned from the database here either (diff)
downloadsynapse-e7b25a649cac1491124fcac80306517238e4de05.tar.xz
Merge pull request #166 from matrix-org/bugs/SYN-390
SYN-390: Don't modify the dictionary returned from the database here either
Diffstat (limited to 'synapse/push/__init__.py')
-rw-r--r--synapse/push/__init__.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/synapse/push/__init__.py b/synapse/push/__init__.py
index e3dd4ce76d..167b973b2b 100644
--- a/synapse/push/__init__.py
+++ b/synapse/push/__init__.py
@@ -74,15 +74,18 @@ class Pusher(object):
 
         rawrules = yield self.store.get_push_rules_for_user(self.user_name)
 
-        for r in rawrules:
-            r['conditions'] = json.loads(r['conditions'])
-            r['actions'] = json.loads(r['actions'])
+        rules = []
+        for rawrule in rawrules:
+            rule = dict(rawrules)
+            rule['conditions'] = json.loads(rawrule['conditions'])
+            rule['actions'] = json.loads(rawrule['actions'])
+            rules.append(rule)
 
         enabled_map = yield self.store.get_push_rules_enabled_for_user(self.user_name)
 
         user = UserID.from_string(self.user_name)
 
-        rules = baserules.list_with_base_rules(rawrules, user)
+        rules = baserules.list_with_base_rules(rules, user)
 
         room_id = ev['room_id']