fix: 修改domain创建的assets不是必填的

pull/4113/head
ibuler 5 years ago
parent 6d30fe797c
commit 220ccda04d

@ -15,11 +15,18 @@ class DomainSerializer(BulkOrgResourceModelSerializer):
class Meta:
model = Domain
fields = [
'id', 'name', 'asset_count', 'gateway_count', 'comment', 'assets',
'date_created'
fields_mini = ['id', 'name']
fields_small = fields_mini + [
'comment', 'date_created'
]
fields_m2m = [
'asset_count', 'assets', 'gateway_count',
]
read_only_fields = ( 'asset_count', 'gateway_count', 'date_created')
fields = fields_small + fields_m2m
read_only_fields = ('asset_count', 'gateway_count', 'date_created')
extra_kwargs = {
'assets': {'required': False}
}
list_serializer_class = AdaptedBulkListSerializer
@staticmethod

Loading…
Cancel
Save