From a2fdc9042053e0eb7a751609571dd753b3f1476b Mon Sep 17 00:00:00 2001 From: Sam Estep Date: Tue, 2 Jun 2026 18:47:11 -0400 Subject: [PATCH] Fix `graphite.util.epoch` for Django 5 Co-Authored-By: Claude Opus 4.8 --- webapp/graphite/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/graphite/util.py b/webapp/graphite/util.py index bb46fa16c..7152cb765 100644 --- a/webapp/graphite/util.py +++ b/webapp/graphite/util.py @@ -59,7 +59,7 @@ def epoch(dt): if not dt.tzinfo: tb = traceback.extract_stack(None, 2) log.warning('epoch() called with non-timezone-aware datetime in %s at %s:%d' % (tb[0][2], tb[0][0], tb[0][1])) - return calendar.timegm(make_aware(dt, pytz.timezone(settings.TIME_ZONE)).astimezone(pytz.utc).timetuple()) + return calendar.timegm(pytz.timezone(settings.TIME_ZONE).localize(dt, is_dst=None).astimezone(pytz.utc).timetuple()) return calendar.timegm(dt.astimezone(pytz.utc).timetuple())