mirror of
https://github.com/ansible/awx.git
synced 2026-05-06 17:07:36 -02:30
remove JobTemplate.job_type = 'scan'
see: https://github.com/ansible/awx/issues/5603
This commit is contained in:
24
awx/main/migrations/0104_v370_cleanup_old_scan_jts.py
Normal file
24
awx/main/migrations/0104_v370_cleanup_old_scan_jts.py
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
# Generated by Django 2.2.8 on 2020-01-15 20:01
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
def cleanup_scan_jts(apps, schema_editor):
|
||||||
|
JobTemplate = apps.get_model('main', 'JobTemplate')
|
||||||
|
JobTemplate.objects.filter(job_type='scan').update(job_type='run')
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('main', '0103_v370_remove_computed_fields'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RunPython(cleanup_scan_jts),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='jobtemplate',
|
||||||
|
name='job_type',
|
||||||
|
field=models.CharField(choices=[('run', 'Run'), ('check', 'Check')], default='run', max_length=64),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -29,7 +29,7 @@ from awx.api.versioning import reverse
|
|||||||
from awx.main.models.base import (
|
from awx.main.models.base import (
|
||||||
BaseModel, CreatedModifiedModel,
|
BaseModel, CreatedModifiedModel,
|
||||||
prevent_search, accepts_json,
|
prevent_search, accepts_json,
|
||||||
JOB_TYPE_CHOICES, VERBOSITY_CHOICES,
|
JOB_TYPE_CHOICES, NEW_JOB_TYPE_CHOICES, VERBOSITY_CHOICES,
|
||||||
VarsDictProperty
|
VarsDictProperty
|
||||||
)
|
)
|
||||||
from awx.main.models.events import JobEvent, SystemJobEvent
|
from awx.main.models.events import JobEvent, SystemJobEvent
|
||||||
@@ -205,6 +205,11 @@ class JobTemplate(UnifiedJobTemplate, JobOptions, SurveyJobTemplateMixin, Resour
|
|||||||
app_label = 'main'
|
app_label = 'main'
|
||||||
ordering = ('name',)
|
ordering = ('name',)
|
||||||
|
|
||||||
|
job_type = models.CharField(
|
||||||
|
max_length=64,
|
||||||
|
choices=NEW_JOB_TYPE_CHOICES,
|
||||||
|
default='run',
|
||||||
|
)
|
||||||
host_config_key = prevent_search(models.CharField(
|
host_config_key = prevent_search(models.CharField(
|
||||||
max_length=1024,
|
max_length=1024,
|
||||||
blank=True,
|
blank=True,
|
||||||
|
|||||||
Reference in New Issue
Block a user