This commit is contained in:
j3d1 2026-08-31 13:02:06 +02:00
parent d606de8773
commit 2218cc3543
12 changed files with 393 additions and 2204 deletions

View file

@ -14,7 +14,7 @@ class FileSerializer(serializers.Serializer):
def to_representation(self, instance):
return {'id': instance.id, 'name': instance.file.url, 'size': instance.file.size,
'mime_type': instance.mime_type}
'mime_type': instance.mime_type, 'hash': instance.hash}
def create(self, validated_data):
return File.objects.get_or_create(**validated_data)[0]