From 0be3cb3c271ee91400d7f12ccba15ed326dda6a7 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Wed, 22 Mar 2023 19:14:43 +0800 Subject: [PATCH] fix: account update (#10039) Co-authored-by: feng <1304903146@qq.com> --- apps/accounts/validator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/accounts/validator.py b/apps/accounts/validator.py index ccf1e8c11..b8c49896d 100644 --- a/apps/accounts/validator.py +++ b/apps/accounts/validator.py @@ -45,7 +45,10 @@ class SecretTypeValidator: def __call__(self, attrs, serializer): secret_types = set() - asset = attrs['asset'] + if serializer.instance: + asset = serializer.instance.asset + else: + asset = attrs['asset'] secret_type = attrs['secret_type'] platform_protocols_dict = { name: self.protocol_settings.get(name, {}).get('secret_types', [])