perf: 创建网域时资产不用必选 (#12766)

Co-authored-by: feng <1304903146@qq.com>
pull/12773/head
fit2bot 2024-03-07 11:20:40 +08:00 committed by GitHub
parent 6c89349194
commit b3e73605b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -25,6 +25,9 @@ class DomainSerializer(ResourceLabelsMixin, BulkOrgResourceModelSerializer):
fields_m2m = ['assets', 'gateways']
read_only_fields = ['date_created']
fields = fields_small + fields_m2m + read_only_fields
extra_kwargs = {
'assets': {'required': False},
}
def to_representation(self, instance):
data = super().to_representation(instance)