Browse Source

fix: 修复资产列表 mini 时报错 (#10220)

Co-authored-by: ibuler <ibuler@qq.com>
pull/10223/head
fit2bot 2 years ago committed by GitHub
parent
commit
2b00e6e3a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      apps/assets/serializers/asset/common.py

4
apps/assets/serializers/asset/common.py

@ -176,8 +176,12 @@ class AssetSerializer(BulkOrgResourceModelSerializer, WritableNestedModelSeriali
return
category = request.path.strip('/').split('/')[-1].rstrip('s')
field_category = self.fields.get('category')
if not field_category:
return
field_category.choices = Category.filter_choices(category)
field_type = self.fields.get('type')
if not field_type:
return
field_type.choices = AllTypes.filter_choices(category)
@classmethod

Loading…
Cancel
Save