summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2019-09-06 13:23:10 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2019-09-06 13:23:10 +0100
commit6ddda8152ed4f8111d8108f6f2f92f365b9069ba (patch)
tree22c4fa471e0c74ad3eb68df941316c021a83d3d9 /synapse/storage
parentChange changelog (diff)
downloadsynapse-6ddda8152ed4f8111d8108f6f2f92f365b9069ba.tar.xz
Move delete_threepid_session into RegistrationWorkerStore
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/registration.py50
1 files changed, 25 insertions, 25 deletions
diff --git a/synapse/storage/registration.py b/synapse/storage/registration.py
index 24509bd455..5138792a5f 100644
--- a/synapse/storage/registration.py
+++ b/synapse/storage/registration.py
@@ -668,6 +668,31 @@ class RegistrationWorkerStore(SQLBaseStore):
             "get_threepid_validation_session", get_threepid_validation_session_txn
         )
 
+    def delete_threepid_session(self, session_id):
+        """Removes a threepid validation session from the database. This can
+        be done after validation has been performed and whatever action was
+        waiting on it has been carried out
+
+        Args:
+            session_id (str): The ID of the session to delete
+        """
+
+        def delete_threepid_session_txn(txn):
+            self._simple_delete_txn(
+                txn,
+                table="threepid_validation_token",
+                keyvalues={"session_id": session_id},
+            )
+            self._simple_delete_txn(
+                txn,
+                table="threepid_validation_session",
+                keyvalues={"session_id": session_id},
+            )
+
+        return self.runInteraction(
+            "delete_threepid_session", delete_threepid_session_txn
+        )
+
 
 class RegistrationStore(
     RegistrationWorkerStore, background_updates.BackgroundUpdateStore
@@ -1323,31 +1348,6 @@ class RegistrationStore(
             self.clock.time_msec(),
         )
 
-    def delete_threepid_session(self, session_id):
-        """Removes a threepid validation session from the database. This can
-        be done after validation has been performed and whatever action was
-        waiting on it has been carried out
-
-        Args:
-            session_id (str): The ID of the session to delete
-        """
-
-        def delete_threepid_session_txn(txn):
-            self._simple_delete_txn(
-                txn,
-                table="threepid_validation_token",
-                keyvalues={"session_id": session_id},
-            )
-            self._simple_delete_txn(
-                txn,
-                table="threepid_validation_session",
-                keyvalues={"session_id": session_id},
-            )
-
-        return self.runInteraction(
-            "delete_threepid_session", delete_threepid_session_txn
-        )
-
     def set_user_deactivated_status_txn(self, txn, user_id, deactivated):
         self._simple_update_one_txn(
             txn=txn,