diff --git a/apps/assets/const/custom.py b/apps/assets/const/custom.py index be9cdcc92..47d4e9229 100644 --- a/apps/assets/const/custom.py +++ b/apps/assets/const/custom.py @@ -4,7 +4,11 @@ from .base import BaseType class CustomTypes(BaseType): @classmethod def get_choices(cls): - types = cls.get_custom_platforms().values_list('type', flat=True).distinct() + try: + platforms = list(cls.get_custom_platforms()) + except Exception: + return [] + types = [p.type for p in platforms] return [(t, t) for t in types] @classmethod diff --git a/apps/assets/migrations/0112_auto_20230404_1631.py b/apps/assets/migrations/0112_auto_20230404_1631.py index cf1c6268a..72285123a 100644 --- a/apps/assets/migrations/0112_auto_20230404_1631.py +++ b/apps/assets/migrations/0112_auto_20230404_1631.py @@ -32,14 +32,13 @@ class Migration(migrations.Migration): name='custom_info', field=models.JSONField(default=dict, verbose_name='Custom info'), ), - migrations.RenameField( - model_name='asset', - old_name='info', - new_name='gathered_info', - ), - migrations.AlterField( + migrations.AddField( model_name='asset', name='gathered_info', field=models.JSONField(blank=True, default=dict, verbose_name='Gathered info'), ), + migrations.RemoveField( + model_name='asset', + name='info', + ), ]