fix: Initialize historical_event variable to None.

This commit is contained in:
pacnpal
2026-01-04 19:14:55 -05:00
parent 30aa887d2a
commit 70e4385c2b

View File

@@ -382,6 +382,7 @@ class Park(StateMachineMixin, TrackedModel):
# Try pghistory events # Try pghistory events
print("Searching pghistory events") print("Searching pghistory events")
event_model = getattr(cls, "event_model", None) event_model = getattr(cls, "event_model", None)
historical_event = None
if event_model: if event_model:
historical_event = event_model.objects.filter(slug=slug).order_by("-pgh_created_at").first() historical_event = event_model.objects.filter(slug=slug).order_by("-pgh_created_at").first()