mirror of
https://github.com/ansible/awx.git
synced 2026-01-22 23:18:03 -03:30
Fix an issue where POST to schedules would no longer work. Populate
some more summary fields
This commit is contained in:
parent
35e4bd477c
commit
9b440c5209
@ -67,6 +67,8 @@ SUMMARIZABLE_FK_FIELDS = {
|
||||
'permission': DEFAULT_SUMMARY_FIELDS,
|
||||
'job': DEFAULT_SUMMARY_FIELDS + ('status', 'failed',),
|
||||
'job_template': DEFAULT_SUMMARY_FIELDS,
|
||||
'schedule': DEFAULT_SUMMARY_FIELDS + ('next_run',),
|
||||
'unified_job_template': DEFAULT_SUMMARY_FIELDS,
|
||||
'last_job': DEFAULT_SUMMARY_FIELDS + ('status', 'failed', 'license_error'),
|
||||
'last_job_host_summary': DEFAULT_SUMMARY_FIELDS + ('failed',),
|
||||
'last_update': DEFAULT_SUMMARY_FIELDS + ('status', 'failed', 'license_error'),
|
||||
@ -1305,7 +1307,7 @@ class ScheduleSerializer(BaseSerializer):
|
||||
|
||||
class Meta:
|
||||
model = Schedule
|
||||
fields = ('*', 'enabled', 'dtstart', 'dtend', 'rrule', 'next_run')
|
||||
fields = ('*', 'unified_job_template', 'enabled', 'dtstart', 'dtend', 'rrule', 'next_run')
|
||||
|
||||
def get_related(self, obj):
|
||||
res = super(ScheduleSerializer, self).get_related(obj)
|
||||
@ -1320,12 +1322,12 @@ class ScheduleSerializer(BaseSerializer):
|
||||
|
||||
# We reject rrules if:
|
||||
# - DTSTART is not include
|
||||
# - INTERVAL is not included
|
||||
# - TZID is used
|
||||
# - multiple BYDAY (except WEEKLY), BYMONTHDAY, BYMONTH
|
||||
# - BYDAY prefixed with a number (MO is good but not 20MO)
|
||||
# - BYYEARDAY
|
||||
# - BYWEEKNO
|
||||
# - INTERVAL required
|
||||
def validate_rrule(self, attrs, source):
|
||||
rrule_value = attrs[source]
|
||||
if not 'dtstart' in rrule_value.lower():
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user