mirror of
https://mau.dev/maunium/synapse.git
synced 2024-11-18 07:52:56 +01:00
rename db method to be more informative
This commit is contained in:
parent
2f475bd5d5
commit
f8152f2708
2 changed files with 5 additions and 5 deletions
|
@ -244,7 +244,7 @@ class SynapseHomeServer(HomeServer):
|
|||
|
||||
@defer.inlineCallbacks
|
||||
def post_startup_check(self):
|
||||
all_users_native = yield self.get_datastore().all_users_on_domain(
|
||||
all_users_native = yield self.get_datastore().are_all_users_on_domain(
|
||||
self.hostname
|
||||
)
|
||||
if not all_users_native:
|
||||
|
|
|
@ -146,15 +146,15 @@ class RegistrationStore(SQLBaseStore):
|
|||
raise StoreError(404, "Token not found.")
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def all_users_on_domain(self, domain):
|
||||
def are_all_users_on_domain(self, domain):
|
||||
res = yield self.runInteraction(
|
||||
"all_users_on_domain",
|
||||
self._all_users_on_domain_txn,
|
||||
"are_all_users_on_domain",
|
||||
self._are_all_users_on_domain_txn,
|
||||
domain
|
||||
)
|
||||
defer.returnValue(res)
|
||||
|
||||
def _all_users_on_domain_txn(self, txn, domain):
|
||||
def _are_all_users_on_domain_txn(self, txn, domain):
|
||||
sql = "SELECT COUNT(*) FROM users WHERE name NOT LIKE ?"
|
||||
pat = "%:" + domain
|
||||
cursor = txn.execute(sql, (pat,))
|
||||
|
|
Loading…
Reference in a new issue