fix: account update (#10039)

Co-authored-by: feng <1304903146@qq.com>
pull/10045/head
fit2bot 2023-03-22 19:14:43 +08:00 committed by GitHub
parent f7ae23f7d9
commit 0be3cb3c27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -45,7 +45,10 @@ class SecretTypeValidator:
def __call__(self, attrs, serializer): def __call__(self, attrs, serializer):
secret_types = set() secret_types = set()
asset = attrs['asset'] if serializer.instance:
asset = serializer.instance.asset
else:
asset = attrs['asset']
secret_type = attrs['secret_type'] secret_type = attrs['secret_type']
platform_protocols_dict = { platform_protocols_dict = {
name: self.protocol_settings.get(name, {}).get('secret_types', []) name: self.protocol_settings.get(name, {}).get('secret_types', [])