fix: 账号导入500 (#10255)

Co-authored-by: feng <1304903146@qq.com>
This commit is contained in:
fit2bot
2023-04-19 10:57:38 +08:00
committed by GitHub
parent 3bc8eda66a
commit fc4a77df1a
2 changed files with 8 additions and 1 deletions

View File

@@ -75,6 +75,9 @@ class AccountCreateUpdateSerializerMixin(serializers.Serializer):
initial_data['name'] = name
def from_template_if_need(self, initial_data):
if isinstance(initial_data, str):
return
template_id = initial_data.pop('template', None)
if not template_id:
return