kopia lustrzana https://dev.funkwhale.audio/funkwhale/funkwhale
				
				
				
			Fixed UI crash when updating avatar
							rodzic
							
								
									35e2cb243c
								
							
						
					
					
						commit
						27f40e6023
					
				| 
						 | 
				
			
			@ -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(
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Ładowanie…
	
		Reference in New Issue