From 2c82489691d0b6eca3b05d808e0645c402c626a3 Mon Sep 17 00:00:00 2001 From: pacnpal <183241239+pacnpal@users.noreply.github.com> Date: Thu, 6 Feb 2025 20:38:38 -0500 Subject: [PATCH] Add timezone utility and current branch signal to enhance park detail functionality --- history_tracking/views.py | 1 + parks/models.py | 1 + parks/templates/parks/park_detail.html | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/history_tracking/views.py b/history_tracking/views.py index c6bb27a6..5fe45989 100644 --- a/history_tracking/views.py +++ b/history_tracking/views.py @@ -5,6 +5,7 @@ from django.template.loader import render_to_string from django.contrib.auth.mixins import LoginRequiredMixin from django.core.exceptions import ValidationError from django.db import transaction +from django.utils import timezone from .models import VersionBranch, VersionTag, ChangeSet from .managers import BranchManager, ChangeTracker, MergeStrategy diff --git a/parks/models.py b/parks/models.py index d15fffc1..a50e144d 100644 --- a/parks/models.py +++ b/parks/models.py @@ -7,6 +7,7 @@ from decimal import Decimal, ROUND_DOWN, InvalidOperation from typing import Tuple, Optional, Any, TYPE_CHECKING from companies.models import Company +from history_tracking.signals import get_current_branch from media.models import Photo from history_tracking.models import HistoricalModel from location.models import Location diff --git a/parks/templates/parks/park_detail.html b/parks/templates/parks/park_detail.html index fbcfee01..cc422b40 100644 --- a/parks/templates/parks/park_detail.html +++ b/parks/templates/parks/park_detail.html @@ -168,7 +168,7 @@ {% for photo in park.photos.all|slice:":4" %}