perf: patch account 400 (#10153)

Co-authored-by: feng <1304903146@qq.com>
pull/10159/head
fit2bot 2023-04-06 19:53:01 +08:00 committed by GitHub
parent fb1978a40b
commit e34fbce082
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -57,6 +57,8 @@ class AccountCreateUpdateSerializerMixin(serializers.Serializer):
def set_uniq_name_if_need(self, initial_data, asset):
name = initial_data.get('name')
if name is None:
return
if not name:
name = initial_data.get('username')
if self.instance and self.instance.name == name: