mirror of
https://github.com/ZwareBear/awx.git
synced 2026-04-16 21:11:49 -05:00
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:
committed by
Jared Tabor
parent
e5dd3a9626
commit
fbe2391b86
@@ -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)
|
||||
|
||||
@@ -745,11 +745,7 @@ class ScheduleZoneInfo(APIView):
|
||||
swagger_topic = 'System Configuration'
|
||||
|
||||
def get(self, request):
|
||||
from dateutil.zoneinfo import get_zonefile_instance
|
||||
return Response([
|
||||
{'name': zone}
|
||||
for zone in sorted(get_zonefile_instance().zones)
|
||||
])
|
||||
return Response(Schedule.get_zoneinfo())
|
||||
|
||||
|
||||
class LaunchConfigCredentialsBase(SubListAttachDetachAPIView):
|
||||
|
||||
Reference in New Issue
Block a user