mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-10-01 08:25:44 -04:00
rename db method to be more informative
This commit is contained in:
parent
2f475bd5d5
commit
f8152f2708
@ -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 New Issue
Block a user