rename db method to be more informative

This commit is contained in:
David Baker 2015-04-27 10:16:26 +01:00
parent 2f475bd5d5
commit f8152f2708
2 changed files with 5 additions and 5 deletions

View File

@ -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:

View File

@ -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,))