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
|
@defer.inlineCallbacks
|
||||||
def post_startup_check(self):
|
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
|
self.hostname
|
||||||
)
|
)
|
||||||
if not all_users_native:
|
if not all_users_native:
|
||||||
|
@ -146,15 +146,15 @@ class RegistrationStore(SQLBaseStore):
|
|||||||
raise StoreError(404, "Token not found.")
|
raise StoreError(404, "Token not found.")
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def all_users_on_domain(self, domain):
|
def are_all_users_on_domain(self, domain):
|
||||||
res = yield self.runInteraction(
|
res = yield self.runInteraction(
|
||||||
"all_users_on_domain",
|
"are_all_users_on_domain",
|
||||||
self._all_users_on_domain_txn,
|
self._are_all_users_on_domain_txn,
|
||||||
domain
|
domain
|
||||||
)
|
)
|
||||||
defer.returnValue(res)
|
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 ?"
|
sql = "SELECT COUNT(*) FROM users WHERE name NOT LIKE ?"
|
||||||
pat = "%:" + domain
|
pat = "%:" + domain
|
||||||
cursor = txn.execute(sql, (pat,))
|
cursor = txn.execute(sql, (pat,))
|
||||||
|
Loading…
Reference in New Issue
Block a user