summary refs log tree commit diff
path: root/synapse/storage/registration.py
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2015-05-01 14:21:03 +0100
committerDavid Baker <dave@matrix.org>2015-05-01 14:21:25 +0100
commit9eeb03c0dd148d992afed3ee9c241cd6ec01a1bd (patch)
tree0f28a07cbb07502a0242be71a244bbaca547ba3d /synapse/storage/registration.py
parentdatabase config is not kept in separate config file anymore (diff)
downloadsynapse-9eeb03c0dd148d992afed3ee9c241cd6ec01a1bd.tar.xz
Don't use self.execute: it's designed for fetching stuff
Diffstat (limited to '')
-rw-r--r--synapse/storage/registration.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/synapse/storage/registration.py b/synapse/storage/registration.py
index ff0a2a9e8b..530bbe6b45 100644
--- a/synapse/storage/registration.py
+++ b/synapse/storage/registration.py
@@ -112,10 +112,15 @@ class RegistrationStore(SQLBaseStore):
 
     @defer.inlineCallbacks
     def user_delete_access_tokens_apart_from(self, user_id, token_id):
-        yield self._execute(
-            "delete_access_tokens_apart_from", None,
+        yield self.runInteraction(
+            "user_delete_access_tokens_apart_from",
+            self._user_delete_access_tokens_apart_from, user_id, token_id
+        )
+
+    def _user_delete_access_tokens_apart_from(self, txn, user_id, token_id):
+        txn.execute(
             "DELETE FROM access_tokens WHERE user_id = ? AND id != ?",
-            user_id, token_id
+            (user_id, token_id)
         )
 
     @defer.inlineCallbacks