Просмотр исходного кода

Set ImageAttachmentSerializer.image_width and image_height to read_only

Brian Tiemann 1 год назад
Родитель
Сommit
85f8364cd7
1 измененных файлов с 2 добавлено и 0 удалено
  1. 2 0
      netbox/extras/api/serializers_/attachments.py

+ 2 - 0
netbox/extras/api/serializers_/attachments.py

@@ -19,6 +19,8 @@ class ImageAttachmentSerializer(ValidatedModelSerializer):
         queryset=ObjectType.objects.all()
     )
     parent = serializers.SerializerMethodField(read_only=True)
+    image_width = serializers.IntegerField(read_only=True)
+    image_height = serializers.IntegerField(read_only=True)
 
     class Meta:
         model = ImageAttachment