mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-04 06:34:56 -04:00
Always allow the empty string as an avatar_url. (#12261)
Hopefully this fixes #12257. Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
This commit is contained in:
parent
61aae18d45
commit
fffb3c4c8f
4 changed files with 32 additions and 0 deletions
|
@ -1050,6 +1050,25 @@ class DeactivateAccountTestCase(unittest.HomeserverTestCase):
|
|||
|
||||
self._is_erased("@user:test", True)
|
||||
|
||||
@override_config({"max_avatar_size": 1234})
|
||||
def test_deactivate_user_erase_true_avatar_nonnull_but_empty(self) -> None:
|
||||
"""Check we can erase a user whose avatar is the empty string.
|
||||
|
||||
Reproduces #12257.
|
||||
"""
|
||||
# Patch `self.other_user` to have an empty string as their avatar.
|
||||
self.get_success(self.store.set_profile_avatar_url("user", ""))
|
||||
|
||||
# Check we can still erase them.
|
||||
channel = self.make_request(
|
||||
"POST",
|
||||
self.url,
|
||||
access_token=self.admin_user_tok,
|
||||
content={"erase": True},
|
||||
)
|
||||
self.assertEqual(HTTPStatus.OK, channel.code, msg=channel.json_body)
|
||||
self._is_erased("@user:test", True)
|
||||
|
||||
def test_deactivate_user_erase_false(self) -> None:
|
||||
"""
|
||||
Test deactivating a user and set `erase` to `false`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue