summary refs log tree commit diff
path: root/synapse/storage/registration.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-11-10 18:24:43 +0000
committerErik Johnston <erik@matrix.org>2014-11-10 18:25:42 +0000
commita8e565eca8cbfcedbdfd812c98a6545c2fc31afd (patch)
treed55fba621e45804cd27829415b0e588b7e9fa51c /synapse/storage/registration.py
parentFix rest.test_events. Convert to use SQLiteMemoryDbPool (diff)
downloadsynapse-a8e565eca8cbfcedbdfd812c98a6545c2fc31afd.tar.xz
Add an EventValidator. Fix bugs in auth ++ storage
Diffstat (limited to 'synapse/storage/registration.py')
-rw-r--r--synapse/storage/registration.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/storage/registration.py b/synapse/storage/registration.py
index a2ca6f9a69..1f89d77344 100644
--- a/synapse/storage/registration.py
+++ b/synapse/storage/registration.py
@@ -107,13 +107,17 @@ class RegistrationStore(SQLBaseStore):
             token
         )
 
+    @defer.inlineCallbacks
     def is_server_admin(self, user):
-        return self._simple_select_one_onecol(
+        res = yield self._simple_select_one_onecol(
             table="users",
             keyvalues={"name": user.to_string()},
             retcol="admin",
+            allow_none=True,
         )
 
+        defer.returnValue(res if res else False)
+
     def _query_for_auth(self, txn, token):
         sql = (
             "SELECT users.name, users.admin, access_tokens.device_id "