From 34b5e98b66572531c7997c8cb91908836414953c Mon Sep 17 00:00:00 2001 From: Md Bayazid Bostame Date: Mon, 30 Mar 2026 12:51:21 +0200 Subject: [PATCH] fix: version static assets on test deployment --- backend/config/settings.py | 2 ++ backend/workflows/context_processors.py | 2 ++ backend/workflows/templates/workflows/base_shell.html | 10 +++++----- .../templates/workflows/requests_dashboard.html | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/backend/config/settings.py b/backend/config/settings.py index 18457cf..3a0db7a 100644 --- a/backend/config/settings.py +++ b/backend/config/settings.py @@ -1,9 +1,11 @@ import os import sys +import time from pathlib import Path from urllib.parse import urlsplit BASE_DIR = Path(__file__).resolve().parent.parent +STATIC_ASSET_VERSION = os.getenv('STATIC_ASSET_VERSION', str(int(time.time()))) def _split_csv_env(name: str, default: str = ''): return [item.strip() for item in os.getenv(name, default).split(',') if item.strip()] diff --git a/backend/workflows/context_processors.py b/backend/workflows/context_processors.py index e31f0e4..6fac856 100644 --- a/backend/workflows/context_processors.py +++ b/backend/workflows/context_processors.py @@ -1,4 +1,5 @@ from .branding import get_branding_context, get_trial_context +from django.conf import settings from .models import UserNotification from .roles import template_role_context @@ -18,4 +19,5 @@ def role_context(request): ) else: context.update({'header_notifications': [], 'header_unread_notification_count': 0}) + context.update({'static_asset_version': settings.STATIC_ASSET_VERSION}) return context diff --git a/backend/workflows/templates/workflows/base_shell.html b/backend/workflows/templates/workflows/base_shell.html index adf0265..54e2e6b 100644 --- a/backend/workflows/templates/workflows/base_shell.html +++ b/backend/workflows/templates/workflows/base_shell.html @@ -7,9 +7,9 @@ {% block title %}{% endblock %} - - - + + + {% block extra_css %}{% endblock %} {% block extra_head %}{% endblock %} @@ -93,8 +93,8 @@ - - + + {% block extra_scripts %}{% endblock %} diff --git a/backend/workflows/templates/workflows/requests_dashboard.html b/backend/workflows/templates/workflows/requests_dashboard.html index 0e6a7ce..db974fc 100644 --- a/backend/workflows/templates/workflows/requests_dashboard.html +++ b/backend/workflows/templates/workflows/requests_dashboard.html @@ -10,7 +10,7 @@ {% block extra_css %} - + {% endblock %} {% block shell_body %} @@ -298,5 +298,5 @@ {% endblock %} {% block extra_scripts %} - + {% endblock %}