Skip to content
Snippets Groups Projects
Commit 5fcdabf3 authored by Agate's avatar Agate 💬
Browse files

Merge branch 'avatar-change' into 'develop'

Fixed UI crash when updating avatar

See merge request funkwhale/funkwhale!1101
parents 35e2cb24 27f40e60
No related branches found
No related tags found
No related merge requests found
......@@ -179,6 +179,13 @@ class UserWriteSerializer(serializers.ModelSerializer):
obj.actor.save(update_fields=["attachment_icon"])
return obj
def to_representation(self, instance):
r = super().to_representation(instance)
r["avatar"] = common_serializers.AttachmentSerializer(
instance.get_avatar()
).data
return r
class UserReadSerializer(serializers.ModelSerializer):
......
......@@ -319,6 +319,7 @@ def test_user_can_patch_their_own_avatar(logged_in_api_client, factories):
user.refresh_from_db()
assert user.actor.attachment_icon == attachment
assert "avatar" in response.data
def test_creating_user_creates_actor_as_well(
......
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