Fix for schedule delete 500 from Gabe (#4290)

This commit is contained in:
Alan Rominger 2020-05-05 18:11:51 -04:00 committed by GitHub
parent a7ca6e2eea
commit 1ca29df0de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 2 deletions

View File

@ -0,0 +1,24 @@
# Generated by Django 2.2.11 on 2020-05-04 02:26
import awx.main.utils.polymorphic
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0114_v370_remove_deprecated_manual_inventory_sources'),
]
operations = [
migrations.AlterField(
model_name='unifiedjob',
name='schedule',
field=models.ForeignKey(default=None, editable=False, null=True, on_delete=awx.main.utils.polymorphic.SET_NULL, to='main.Schedule'),
),
migrations.AlterField(
model_name='unifiedjobtemplate',
name='next_schedule',
field=models.ForeignKey(default=None, editable=False, null=True, on_delete=awx.main.utils.polymorphic.SET_NULL, related_name='unifiedjobtemplate_as_next_schedule+', to='main.Schedule'),
),
]

View File

@ -150,7 +150,7 @@ class UnifiedJobTemplate(PolymorphicModel, CommonModelNameNotUnique, Notificatio
default=None,
editable=False,
related_name='%(class)s_as_next_schedule+',
on_delete=models.SET_NULL,
on_delete=polymorphic.SET_NULL,
)
status = models.CharField(
max_length=32,
@ -587,7 +587,7 @@ class UnifiedJob(PolymorphicModel, PasswordFieldsModel, CommonModelNameNotUnique
null=True,
default=None,
editable=False,
on_delete=models.SET_NULL,
on_delete=polymorphic.SET_NULL,
)
dependent_jobs = models.ManyToManyField(
'self',