This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Call set_avatar_url with target_user, not user_id (#8872)
* Call set_avatar_url with target_user, not user_id Fixes #8871 * Create 8872.bugfix * Update synapse/rest/admin/users.py Co-authored-by: Patrick Cloke <[email protected]> * Testing * Update changelog.d/8872.bugfix Co-authored-by: Andrew Morgan <[email protected]> Co-authored-by: Patrick Cloke <[email protected]> Co-authored-by: Andrew Morgan <[email protected]>
- Loading branch information
1 parent
1f3748f
commit ff1f0ee
Showing
3 changed files
with
9 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix a bug where `PUT /_synapse/admin/v2/users/<user_id>` failed to create a new user when `avatar_url` is specified. Bug introduced in Synapse v1.9.0. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -561,7 +561,7 @@ def test_create_server_admin(self): | |
"admin": True, | ||
"displayname": "Bob's name", | ||
"threepids": [{"medium": "email", "address": "[email protected]"}], | ||
"avatar_url": None, | ||
"avatar_url": "mxc://fibble/wibble", | ||
} | ||
) | ||
|
||
|
@@ -578,6 +578,7 @@ def test_create_server_admin(self): | |
self.assertEqual("email", channel.json_body["threepids"][0]["medium"]) | ||
self.assertEqual("[email protected]", channel.json_body["threepids"][0]["address"]) | ||
self.assertEqual(True, channel.json_body["admin"]) | ||
self.assertEqual("mxc://fibble/wibble", channel.json_body["avatar_url"]) | ||
|
||
# Get user | ||
request, channel = self.make_request( | ||
|
@@ -592,6 +593,7 @@ def test_create_server_admin(self): | |
self.assertEqual(True, channel.json_body["admin"]) | ||
self.assertEqual(False, channel.json_body["is_guest"]) | ||
self.assertEqual(False, channel.json_body["deactivated"]) | ||
self.assertEqual("mxc://fibble/wibble", channel.json_body["avatar_url"]) | ||
|
||
def test_create_user(self): | ||
""" | ||
|
@@ -606,6 +608,7 @@ def test_create_user(self): | |
"admin": False, | ||
"displayname": "Bob's name", | ||
"threepids": [{"medium": "email", "address": "[email protected]"}], | ||
"avatar_url": "mxc://fibble/wibble", | ||
} | ||
) | ||
|
||
|
@@ -622,6 +625,7 @@ def test_create_user(self): | |
self.assertEqual("email", channel.json_body["threepids"][0]["medium"]) | ||
self.assertEqual("[email protected]", channel.json_body["threepids"][0]["address"]) | ||
self.assertEqual(False, channel.json_body["admin"]) | ||
self.assertEqual("mxc://fibble/wibble", channel.json_body["avatar_url"]) | ||
|
||
# Get user | ||
request, channel = self.make_request( | ||
|
@@ -636,6 +640,7 @@ def test_create_user(self): | |
self.assertEqual(False, channel.json_body["admin"]) | ||
self.assertEqual(False, channel.json_body["is_guest"]) | ||
self.assertEqual(False, channel.json_body["deactivated"]) | ||
self.assertEqual("mxc://fibble/wibble", channel.json_body["avatar_url"]) | ||
|
||
@override_config( | ||
{"limit_usage_by_mau": True, "max_mau_value": 2, "mau_trial_days": 0} | ||
|