mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-23 18:15:53 +03:00
Revert "Move get_user_count_txn out of base store"
This reverts commit 00f0d67566
.
Its going to get removed soon, so lets not make merge conflicts.
This commit is contained in:
parent
a7f20500ff
commit
9186c105a0
2 changed files with 12 additions and 12 deletions
|
@ -1440,6 +1440,18 @@ class SQLBaseStore(object):
|
||||||
|
|
||||||
return cls.cursor_to_dict(txn)
|
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(
|
def _simple_search_list(
|
||||||
self, table, term, col, retcols, desc="_simple_search_list"
|
self, table, term, col, retcols, desc="_simple_search_list"
|
||||||
):
|
):
|
||||||
|
|
|
@ -516,18 +516,6 @@ class DataStore(
|
||||||
retval = {"users": users, "total": count}
|
retval = {"users": users, "total": count}
|
||||||
return retval
|
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):
|
def search_users(self, term):
|
||||||
"""Function to search users list for one or more users with
|
"""Function to search users list for one or more users with
|
||||||
the matched term.
|
the matched term.
|
||||||
|
|
Loading…
Reference in a new issue