From 024d344f7edd51c6f6c83a10b3b4b7928dfaacf1 Mon Sep 17 00:00:00 2001 From: ibuler Date: Mon, 17 Apr 2023 15:40:05 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=8E=BB=E6=8E=89=20=5Fautmoation=5Fid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/assets/migrations/0115_auto_20230417_1425.py | 7 +------ apps/assets/models/platform.py | 1 - 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/apps/assets/migrations/0115_auto_20230417_1425.py b/apps/assets/migrations/0115_auto_20230417_1425.py index 544891a03..4995ac85e 100644 --- a/apps/assets/migrations/0115_auto_20230417_1425.py +++ b/apps/assets/migrations/0115_auto_20230417_1425.py @@ -24,12 +24,6 @@ def migrate_automation_platform(apps, schema_editor): automation.save(update_fields=['platform']) -def migrate_null_platform_automation(apps, schema_editor): - automation_model = apps.get_model('assets', 'PlatformAutomation') - null_platform_automations = automation_model.objects.filter(platform__isnull=True) - null_platform_automations.delete() - - class Migration(migrations.Migration): dependencies = [ ('assets', '0114_baseautomation_params'), @@ -50,4 +44,5 @@ class Migration(migrations.Migration): related_name='automation', to='assets.platform'), ), migrations.RunPython(migrate_automation_platform), + migrations.RemoveField(model_name='platform', name='_automation_id'), ] diff --git a/apps/assets/models/platform.py b/apps/assets/models/platform.py index 411b9ded4..030e54de3 100644 --- a/apps/assets/models/platform.py +++ b/apps/assets/models/platform.py @@ -101,7 +101,6 @@ class Platform(JMSBaseModel): su_enabled = models.BooleanField(default=False, verbose_name=_("Su enabled")) su_method = models.CharField(max_length=32, blank=True, null=True, verbose_name=_("Su method")) custom_fields = models.JSONField(null=True, default=list, verbose_name=_("Custom fields")) - _automation_id = models.UUIDField(null=True, editable=False) @property def type_constraints(self):