provide the timezone so that the UI doesn't have to

this will also ensure that UI doesn't use a different front end library
that will yield different results than the underlying Python code
This commit is contained in:
Ryan Petrello
2018-05-02 15:23:57 -04:00
committed by Jared Tabor
parent e5dd3a9626
commit fbe2391b86
4 changed files with 52 additions and 7 deletions

View File

@@ -4511,9 +4511,14 @@ class SchedulePreviewSerializer(BaseSerializer):
class ScheduleSerializer(LaunchConfigurationBaseSerializer, SchedulePreviewSerializer):
show_capabilities = ['edit', 'delete']
timezone = serializers.SerializerMethodField()
class Meta:
model = Schedule
fields = ('*', 'unified_job_template', 'enabled', 'dtstart', 'dtend', 'rrule', 'next_run',)
fields = ('*', 'unified_job_template', 'enabled', 'dtstart', 'dtend', 'rrule', 'next_run', 'timezone',)
def get_timezone(self, obj):
return obj.timezone
def get_related(self, obj):
res = super(ScheduleSerializer, self).get_related(obj)