From e34fbce082d214254eca317972b9e42890c30eb8 Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Thu, 6 Apr 2023 19:53:01 +0800 Subject: [PATCH] perf: patch account 400 (#10153) Co-authored-by: feng <1304903146@qq.com> --- apps/accounts/serializers/account/account.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/accounts/serializers/account/account.py b/apps/accounts/serializers/account/account.py index 1d037f594..d5b93dcd8 100644 --- a/apps/accounts/serializers/account/account.py +++ b/apps/accounts/serializers/account/account.py @@ -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: