From 5f2e1c9705cd04f6d09d8d3ea1480573449c0908 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Wed, 16 Oct 2019 09:42:39 -0400 Subject: [PATCH] fix a tz parsing bug --- awx/main/models/schedules.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/awx/main/models/schedules.py b/awx/main/models/schedules.py index d4a5f12914..58aee91d96 100644 --- a/awx/main/models/schedules.py +++ b/awx/main/models/schedules.py @@ -119,10 +119,11 @@ class Schedule(PrimordialModel, LaunchTimeConfig): tzinfo = r._dtstart.tzinfo if tzinfo is utc: return 'UTC' - fname = tzinfo._filename - for zone in all_zones: - if fname.endswith(zone): - return zone + fname = getattr(tzinfo, '_filename', None) + if fname: + for zone in all_zones: + if fname.endswith(zone): + return zone logger.warn('Could not detect valid zoneinfo for {}'.format(self.rrule)) return ''