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

Co-authored-by: ibuler <ibuler@qq.com>
pull/10223/head
fit2bot 2023-04-17 15:10:34 +08:00 committed by GitHub
parent b3b7575b0c
commit 2b00e6e3a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -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