provide a naive UNTIL= datestamp for schedules for UI convenience

This commit is contained in:
Ryan Petrello
2018-05-09 15:11:02 -04:00
parent 056933e33e
commit c52eb0f327
3 changed files with 85 additions and 1 deletions

View File

@@ -4512,14 +4512,19 @@ class ScheduleSerializer(LaunchConfigurationBaseSerializer, SchedulePreviewSeria
show_capabilities = ['edit', 'delete']
timezone = serializers.SerializerMethodField()
until = serializers.SerializerMethodField()
class Meta:
model = Schedule
fields = ('*', 'unified_job_template', 'enabled', 'dtstart', 'dtend', 'rrule', 'next_run', 'timezone',)
fields = ('*', 'unified_job_template', 'enabled', 'dtstart', 'dtend', 'rrule', 'next_run', 'timezone',
'until')
def get_timezone(self, obj):
return obj.timezone
def get_until(self, obj):
return obj.until
def get_related(self, obj):
res = super(ScheduleSerializer, self).get_related(obj)
res.update(dict(