summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--synapse/api/auth.py11
-rw-r--r--tests/test_mau.py1
-rw-r--r--tests/utils.py2
3 files changed, 7 insertions, 7 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index d524ddb4ed..90f9e16bde 100644
--- a/synapse/api/auth.py
+++ b/synapse/api/auth.py
@@ -238,7 +238,6 @@ class Auth(object):
                 errcode=Codes.MISSING_TOKEN
             )
 
-    @defer.inlineCallbacks
     def _get_appservice_user_id(self, request):
         app_service = self.store.get_app_service_by_token(
             self.get_access_token_from_request(
@@ -246,19 +245,19 @@ class Auth(object):
             )
         )
         if app_service is None:
-            defer.returnValue((None, None))
+            return(None, None)
 
         if app_service.ip_range_whitelist:
             ip_address = IPAddress(self.hs.get_ip_from_request(request))
             if ip_address not in app_service.ip_range_whitelist:
-                defer.returnValue((None, None))
+                return(None, None)
 
         if b"user_id" not in request.args:
-            defer.returnValue((app_service.sender, app_service))
+            return(app_service.sender, app_service)
 
         user_id = request.args[b"user_id"][0].decode('utf8')
         if app_service.sender == user_id:
-            defer.returnValue((app_service.sender, app_service))
+            return(app_service.sender, app_service)
 
         if not app_service.is_interested_in_user(user_id):
             raise AuthError(
@@ -271,7 +270,7 @@ class Auth(object):
         #         403,
         #         "Application service has not registered this user"
         #     )
-        defer.returnValue((user_id, app_service))
+        return(user_id, app_service)
 
     @defer.inlineCallbacks
     def get_user_by_access_token(self, token, rights="access"):
diff --git a/tests/test_mau.py b/tests/test_mau.py
index 59d50e54e1..bdbacb8448 100644
--- a/tests/test_mau.py
+++ b/tests/test_mau.py
@@ -63,7 +63,6 @@ class TestMauLimit(unittest.TestCase):
         self.hs.config.server_notices_mxid_display_name = None
         self.hs.config.server_notices_mxid_avatar_url = None
         self.hs.config.server_notices_room_name = "Test Server Notice Room"
-        self.hs.config.register_mxid_from_3pid = None
 
         self.resource = JsonResource(self.hs)
         register.register_servlets(self.hs, self.resource)
diff --git a/tests/utils.py b/tests/utils.py
index 022a868501..5ddf633f56 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -137,6 +137,8 @@ def default_config(name):
     config.admin_contact = None
     config.rc_messages_per_second = 10000
     config.rc_message_burst_count = 10000
+    config.register_mxid_from_3pid = None
+    config.shadow_server = None
 
     config.use_frozen_dicts = False