diff options
author | Erik Johnston <erik@matrix.org> | 2019-12-11 11:34:50 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2019-12-11 11:34:50 +0000 |
commit | d21577bdcbe9dee569ca820604aef92bdda8a67d (patch) | |
tree | 1ade5d4de8470c9cb10d1765af77b5096df72fa3 /synapse/rest/client/v1/profile.py | |
parent | Fixup changelogs (diff) | |
parent | Drop unused index (diff) | |
download | synapse-d21577bdcbe9dee569ca820604aef92bdda8a67d.tar.xz |
Merge branch 'erikj/fix_sqlite_7' of github.com:matrix-org/synapse into release-v1.7.0
Diffstat (limited to 'synapse/rest/client/v1/profile.py')
-rw-r--r-- | synapse/rest/client/v1/profile.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/synapse/rest/client/v1/profile.py b/synapse/rest/client/v1/profile.py index 1eac8a44c5..4f47562c1b 100644 --- a/synapse/rest/client/v1/profile.py +++ b/synapse/rest/client/v1/profile.py @@ -103,11 +103,16 @@ class ProfileAvatarURLRestServlet(RestServlet): content = parse_json_object_from_request(request) try: - new_name = content["avatar_url"] + new_avatar_url = content.get("avatar_url") except Exception: - return 400, "Unable to parse name" + return 400, "Unable to parse avatar_url" + + if new_avatar_url is None: + return 400, "Missing required key: avatar_url" - await self.profile_handler.set_avatar_url(user, requester, new_name, is_admin) + await self.profile_handler.set_avatar_url( + user, requester, new_avatar_url, is_admin + ) return 200, {} |