summary refs log tree commit diff
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2014-09-02 12:53:36 +0100
committerPaul "LeoNerd" Evans <paul@matrix.org>2014-09-02 12:53:36 +0100
commitaa337f588c5f08e6423f43c2e067e2d65db4a6dc (patch)
treebe6fcc2e1ae06aff5979fd5c6b5c1b21293b3d37
parentFix bug where we didn't correctly store the ops power levels event. (diff)
downloadsynapse-aa337f588c5f08e6423f43c2e067e2d65db4a6dc.tar.xz
Order matters when adding REST servlets
Diffstat (limited to '')
-rw-r--r--synapse/rest/profile.py42
1 files changed, 21 insertions, 21 deletions
diff --git a/synapse/rest/profile.py b/synapse/rest/profile.py
index e454ca4661..06076667c7 100644
--- a/synapse/rest/profile.py
+++ b/synapse/rest/profile.py
@@ -21,26 +21,6 @@ from base import RestServlet, client_path_pattern
 import json
 
 
-class ProfileRestServlet(RestServlet):
-    PATTERN = client_path_pattern("/profile/(?P<user_id>[^/]*)")
-
-    @defer.inlineCallbacks
-    def on_GET(self, request, user_id):
-        user = self.hs.parse_userid(user_id)
-
-        displayname = yield self.handlers.profile_handler.get_displayname(
-            user,
-        )
-        avatar_url = yield self.handlers.profile_handler.get_avatar_url(
-            user,
-        )
-
-        defer.returnValue((200, {
-                                    "displayname": displayname,
-                                    "avatar_url": avatar_url
-                                }))
-
-
 class ProfileDisplaynameRestServlet(RestServlet):
     PATTERN = client_path_pattern("/profile/(?P<user_id>[^/]*)/displayname")
 
@@ -107,7 +87,27 @@ class ProfileAvatarURLRestServlet(RestServlet):
         return (200, {})
 
 
+class ProfileRestServlet(RestServlet):
+    PATTERN = client_path_pattern("/profile/(?P<user_id>[^/]*)")
+
+    @defer.inlineCallbacks
+    def on_GET(self, request, user_id):
+        user = self.hs.parse_userid(user_id)
+
+        displayname = yield self.handlers.profile_handler.get_displayname(
+            user,
+        )
+        avatar_url = yield self.handlers.profile_handler.get_avatar_url(
+            user,
+        )
+
+        defer.returnValue((200, {
+                                    "displayname": displayname,
+                                    "avatar_url": avatar_url
+                                }))
+
+
 def register_servlets(hs, http_server):
-    ProfileRestServlet(hs).register(http_server)
     ProfileDisplaynameRestServlet(hs).register(http_server)
     ProfileAvatarURLRestServlet(hs).register(http_server)
+    ProfileRestServlet(hs).register(http_server)