From 9b440c52090168e05e4d24a0d4d672655a8fb9b7 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Fri, 28 Mar 2014 22:10:34 -0400 Subject: [PATCH] Fix an issue where POST to schedules would no longer work. Populate some more summary fields --- awx/api/serializers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/awx/api/serializers.py b/awx/api/serializers.py index e457bcf83c..d13827ac37 100644 --- a/awx/api/serializers.py +++ b/awx/api/serializers.py @@ -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():