mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 01:17:37 -02:30
Additional changes from review
This commit is contained in:
@@ -4683,7 +4683,7 @@ class ScheduleSerializer(LaunchConfigurationBaseSerializer, SchedulePreviewSeria
|
|||||||
|
|
||||||
timezone = serializers.SerializerMethodField(
|
timezone = serializers.SerializerMethodField(
|
||||||
help_text=_(
|
help_text=_(
|
||||||
'The timezone this schedule runs in. This field is extracted from the RRULE. If the timezone in the RRULE is a link to another timezone this field will show the links name.'
|
'The timezone this schedule runs in. This field is extracted from the RRULE. If the timezone in the RRULE is a link to another timezone, the link will be reflected in this field.'
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
until = serializers.SerializerMethodField(
|
until = serializers.SerializerMethodField(
|
||||||
|
|||||||
@@ -578,8 +578,7 @@ class ScheduleZoneInfo(APIView):
|
|||||||
swagger_topic = 'System Configuration'
|
swagger_topic = 'System Configuration'
|
||||||
|
|
||||||
def get(self, request):
|
def get(self, request):
|
||||||
zone_info = models.Schedule.get_zoneinfo_with_links()
|
return Response({'zones': models.Schedule.get_zoneinfo(), 'links': models.Schedule.get_zoneinfo_links()})
|
||||||
return Response(zone_info)
|
|
||||||
|
|
||||||
|
|
||||||
class LaunchConfigCredentialsBase(SubListAttachDetachAPIView):
|
class LaunchConfigCredentialsBase(SubListAttachDetachAPIView):
|
||||||
|
|||||||
@@ -85,16 +85,16 @@ class Schedule(PrimordialModel, LaunchTimeConfig):
|
|||||||
next_run = models.DateTimeField(null=True, default=None, editable=False, help_text=_("The next time that the scheduled action will run."))
|
next_run = models.DateTimeField(null=True, default=None, editable=False, help_text=_("The next time that the scheduled action will run."))
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_zoneinfo(self):
|
def get_zoneinfo(cls):
|
||||||
return sorted(get_zonefile_instance().zones)
|
return sorted(get_zonefile_instance().zones)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_zoneinfo_with_links(self):
|
def get_zoneinfo_links(cls):
|
||||||
|
return_val = {}
|
||||||
zone_instance = get_zonefile_instance()
|
zone_instance = get_zonefile_instance()
|
||||||
return_val = {'zones': sorted(zone_instance.zones), 'links': {}}
|
for zone_name in zone_instance.zones:
|
||||||
for zone_name in return_val['zones']:
|
|
||||||
if str(zone_name) != str(zone_instance.zones[zone_name]._filename):
|
if str(zone_name) != str(zone_instance.zones[zone_name]._filename):
|
||||||
return_val['links'][zone_name] = zone_instance.zones[zone_name]._filename
|
return_val[zone_name] = zone_instance.zones[zone_name]._filename
|
||||||
return return_val
|
return return_val
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|||||||
Reference in New Issue
Block a user