summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-12-04 10:45:59 +0000
committerErik Johnston <erik@matrix.org>2019-12-04 15:21:14 +0000
commit00f0d67566cdfe8eae44aeae1c982c42a255cfcd (patch)
treea6775366ae32a6a17e69932f2f304f2c38c986b2 /synapse
parentNewsfile (diff)
downloadsynapse-00f0d67566cdfe8eae44aeae1c982c42a255cfcd.tar.xz
Move get_user_count_txn out of base store
Diffstat (limited to 'synapse')
-rw-r--r--synapse/storage/_base.py12
-rw-r--r--synapse/storage/data_stores/main/__init__.py12
2 files changed, 12 insertions, 12 deletions
diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py
index c02248cfe9..90019c8b0a 100644
--- a/synapse/storage/_base.py
+++ b/synapse/storage/_base.py
@@ -1440,18 +1440,6 @@ class SQLBaseStore(object):
 
         return cls.cursor_to_dict(txn)
 
-    def get_user_count_txn(self, txn):
-        """Get a total number of registered users in the users list.
-
-        Args:
-            txn : Transaction object
-        Returns:
-            int : number of users
-        """
-        sql_count = "SELECT COUNT(*) FROM users WHERE is_guest = 0;"
-        txn.execute(sql_count)
-        return txn.fetchone()[0]
-
     def _simple_search_list(
         self, table, term, col, retcols, desc="_simple_search_list"
     ):
diff --git a/synapse/storage/data_stores/main/__init__.py b/synapse/storage/data_stores/main/__init__.py
index 474924c68f..76315935dd 100644
--- a/synapse/storage/data_stores/main/__init__.py
+++ b/synapse/storage/data_stores/main/__init__.py
@@ -516,6 +516,18 @@ class DataStore(
         retval = {"users": users, "total": count}
         return retval
 
+    def get_user_count_txn(self, txn):
+        """Get a total number of registered users in the users list.
+
+        Args:
+            txn : Transaction object
+        Returns:
+            int : number of users
+        """
+        sql_count = "SELECT COUNT(*) FROM users WHERE is_guest = 0;"
+        txn.execute(sql_count)
+        return txn.fetchone()[0]
+
     def search_users(self, term):
         """Function to search users list for one or more users with
         the matched term.