perf: Account su_from 返回使用 ObjectRelatedField allow_null allow_empty

This commit is contained in:
Bai
2022-12-06 19:41:26 +08:00
parent 29fd6ee8c9
commit 6233e2b3de

View File

@@ -59,7 +59,7 @@ class AccountSerializer(AccountSerializerCreateMixin, BaseAccountSerializer):
label=_('Asset'), attrs=('id', 'name', 'address', 'platform_id')
)
su_from = ObjectRelatedField(
required=False, queryset=Account.objects,
required=False, queryset=Account.objects, allow_null=True, allow_empty=True,
label=_('Account'), attrs=('id', 'name', 'username')
)