mirror of
https://github.com/ansible/awx.git
synced 2026-03-09 21:49:27 -02:30
Update standalone schedule name uniqueness combining it with unified job template.
Signed-off-by: Vismay Golwala <vgolwala@redhat.com>
This commit is contained in:
@@ -18,7 +18,7 @@ from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
# AWX
|
||||
from awx.api.versioning import reverse
|
||||
from awx.main.models.base import CommonModel
|
||||
from awx.main.models.base import PrimordialModel
|
||||
from awx.main.models.jobs import LaunchTimeConfig
|
||||
from awx.main.utils import ignore_inventory_computed_fields
|
||||
from awx.main.consumers import emit_channel_notification
|
||||
@@ -61,11 +61,12 @@ class ScheduleManager(ScheduleFilterMethods, models.Manager):
|
||||
return ScheduleQuerySet(self.model, using=self._db)
|
||||
|
||||
|
||||
class Schedule(CommonModel, LaunchTimeConfig):
|
||||
class Schedule(PrimordialModel, LaunchTimeConfig):
|
||||
|
||||
class Meta:
|
||||
app_label = 'main'
|
||||
ordering = ['-next_run']
|
||||
unique_together = ('unified_job_template', 'name')
|
||||
|
||||
objects = ScheduleManager()
|
||||
|
||||
@@ -74,6 +75,9 @@ class Schedule(CommonModel, LaunchTimeConfig):
|
||||
related_name='schedules',
|
||||
on_delete=models.CASCADE,
|
||||
)
|
||||
name = models.CharField(
|
||||
max_length=512,
|
||||
)
|
||||
enabled = models.BooleanField(
|
||||
default=True,
|
||||
help_text=_("Enables processing of this schedule.")
|
||||
|
||||
Reference in New Issue
Block a user