From 9a18ed631cdb948d81fe53b9eeca36ac92e77a84 Mon Sep 17 00:00:00 2001 From: ibuler Date: Wed, 30 Oct 2024 16:28:04 +0800 Subject: [PATCH] fix: oracle platform create error --- apps/assets/const/types.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/assets/const/types.py b/apps/assets/const/types.py index 41944e803..1906231c6 100644 --- a/apps/assets/const/types.py +++ b/apps/assets/const/types.py @@ -3,6 +3,7 @@ from collections import defaultdict from copy import deepcopy from django.conf import settings +from django.utils.functional import lazy from django.utils.translation import gettext as _ from common.db.models import ChoicesMixin @@ -29,15 +30,15 @@ class AllTypes(ChoicesMixin): @classmethod def choices(cls): + return lazy(cls.get_choices, list)() + + @classmethod + def get_choices(cls): choices = [] for tp in cls.includes: choices.extend(tp.get_choices()) return choices - @classmethod - def get_choices(cls): - return cls.choices() - @classmethod def filter_choices(cls, category): choices = dict(cls.category_types()).get(category, cls).get_choices()