mirror of https://github.com/jumpserver/jumpserver
perf: 优化 custom info
parent
616e636837
commit
907fcd7555
|
@ -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
|
||||
|
|
|
@ -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',
|
||||
),
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue