diff options
author | Richard van der Hoff <richard@matrix.org> | 2016-07-26 16:46:53 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2016-07-26 16:46:53 +0100 |
commit | eb359eced44407b1ee9648f10fdf3df63c8d40ad (patch) | |
tree | d2067b5f2fbfcc69f7303c3fa567082a5d9469b6 /synapse/handlers/profile.py | |
parent | Fix typo (diff) | |
download | synapse-eb359eced44407b1ee9648f10fdf3df63c8d40ad.tar.xz |
Add `create_requester` function
Wrap the `Requester` constructor with a function which provides sensible defaults, and use it throughout
Diffstat (limited to 'synapse/handlers/profile.py')
-rw-r--r-- | synapse/handlers/profile.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/synapse/handlers/profile.py b/synapse/handlers/profile.py index 711a6a567f..d9ac09078d 100644 --- a/synapse/handlers/profile.py +++ b/synapse/handlers/profile.py @@ -13,15 +13,15 @@ # See the License for the specific language governing permissions and # limitations under the License. +import logging + from twisted.internet import defer +import synapse.types from synapse.api.errors import SynapseError, AuthError, CodeMessageException -from synapse.types import UserID, Requester - +from synapse.types import UserID from ._base import BaseHandler -import logging - logger = logging.getLogger(__name__) @@ -165,7 +165,9 @@ class ProfileHandler(BaseHandler): try: # Assume the user isn't a guest because we don't let guests set # profile or avatar data. - requester = Requester(user, "", False) + # XXX why are we recreating `requester` here for each room? + # what was wrong with the `requester` we were passed? + requester = synapse.types.create_requester(user) yield handler.update_membership( requester, user, |