From 75496cbe91081eb0eb4bbc30a2b93cf076bd1f6a Mon Sep 17 00:00:00 2001 From: fit2bot <68588906+fit2bot@users.noreply.github.com> Date: Thu, 13 Jun 2024 18:20:00 +0800 Subject: [PATCH] perf: Account backup failed (#13420) Co-authored-by: feng <1304903146@qq.com> --- apps/assets/const/category.py | 1 - apps/assets/const/types.py | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/apps/assets/const/category.py b/apps/assets/const/category.py index 9ccbb134e..8c4d387d8 100644 --- a/apps/assets/const/category.py +++ b/apps/assets/const/category.py @@ -12,7 +12,6 @@ class Category(ChoicesMixin, models.TextChoices): DATABASE = 'database', _("Database") CLOUD = 'cloud', _("Cloud service") WEB = 'web', _("Web") - GPT = 'gpt', "GPT" CUSTOM = 'custom', _("Custom type") @classmethod diff --git a/apps/assets/const/types.py b/apps/assets/const/types.py index b97aa0a3c..b03f22d12 100644 --- a/apps/assets/const/types.py +++ b/apps/assets/const/types.py @@ -155,10 +155,7 @@ class AllTypes(ChoicesMixin): choices = cls.serialize_to_objs(Category.choices) mapper = dict(cls.grouped_choices()) for choice in choices: - choices = mapper.get(choice['value']) - if not choices: - continue - children = cls.serialize_to_objs(choices) + children = cls.serialize_to_objs(mapper[choice['value']]) choice['children'] = children return choices