fix: 批量更新资产账号 错误 secret (#10221)

Co-authored-by: feng <1304903146@qq.com>
pull/10223/head
fit2bot 2 years ago committed by GitHub
parent 690e01cb78
commit b3b7575b0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -264,7 +264,7 @@ class AssetAccountBulkSerializer(AccountCreateUpdateSerializerMixin, serializers
@staticmethod
def _handle_update_create(vd, lookup):
ori = Account.objects.filter(**lookup).first()
if ori and ori.secret == vd['secret']:
if ori and ori.secret == vd.get('secret'):
return ori, False, 'skipped'
instance, value = Account.objects.update_or_create(defaults=vd, **lookup)

Loading…
Cancel
Save