Skip to content
Snippets Groups Projects
Unverified Commit 5e8abe90 authored by Andrew Morgan's avatar Andrew Morgan Committed by GitHub
Browse files

Better errors regarding changing avatar_url (#6497)

parent adfdd82b
No related branches found
No related tags found
No related merge requests found
Fix error message when setting your profile's avatar URL mentioning displaynames, and prevent NoneType avatar_urls.
\ No newline at end of file
......@@ -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, {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment