Extract the client v1 base RestServlet to a separate class

This commit is contained in:
Mark Haines 2015-01-23 14:09:51 +00:00
parent f7cb604211
commit 4be637cb12
11 changed files with 44 additions and 72 deletions

View file

@ -16,13 +16,13 @@
""" This module contains REST servlets to do with profile: /profile/<paths> """
from twisted.internet import defer
from .base import RestServlet, client_path_pattern
from .base import ClientV1RestServlet, client_path_pattern
from synapse.types import UserID
import json
class ProfileDisplaynameRestServlet(RestServlet):
class ProfileDisplaynameRestServlet(ClientV1RestServlet):
PATTERN = client_path_pattern("/profile/(?P<user_id>[^/]*)/displayname")
@defer.inlineCallbacks
@ -55,7 +55,7 @@ class ProfileDisplaynameRestServlet(RestServlet):
return (200, {})
class ProfileAvatarURLRestServlet(RestServlet):
class ProfileAvatarURLRestServlet(ClientV1RestServlet):
PATTERN = client_path_pattern("/profile/(?P<user_id>[^/]*)/avatar_url")
@defer.inlineCallbacks
@ -88,7 +88,7 @@ class ProfileAvatarURLRestServlet(RestServlet):
return (200, {})
class ProfileRestServlet(RestServlet):
class ProfileRestServlet(ClientV1RestServlet):
PATTERN = client_path_pattern("/profile/(?P<user_id>[^/]*)")
@defer.inlineCallbacks