Skip to content

Commit

Permalink
Added allow_null for front and rear image on api (#15200)
Browse files Browse the repository at this point in the history
* added allow_null for front and rear image on api #15184

* added allow_null for front and rear image on api #15184
  • Loading branch information
abhi1693 authored Feb 20, 2024
1 parent dbcd713 commit 839609d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions netbox/dcim/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,8 @@ class DeviceTypeSerializer(NetBoxModelSerializer):
airflow = ChoiceField(choices=DeviceAirflowChoices, allow_blank=True, required=False, allow_null=True)
weight_unit = ChoiceField(choices=WeightUnitChoices, allow_blank=True, required=False, allow_null=True)
device_count = serializers.IntegerField(read_only=True)
front_image = serializers.URLField(allow_null=True, required=False)

This comment has been minimized.

Copy link
@jbemmel

jbemmel Mar 6, 2024

This change breaks image upload via a PATCH request to the API.
These are file upload fields (binary), not URL

rear_image = serializers.URLField(allow_null=True, required=False)

# Counter fields
console_port_template_count = serializers.IntegerField(read_only=True)
Expand Down

0 comments on commit 839609d

Please sign in to comment.