diff --git a/allianceauth/custom_css/templatetags/custom_css.py b/allianceauth/custom_css/templatetags/custom_css.py index 2f355d45..d3a935a9 100644 --- a/allianceauth/custom_css/templatetags/custom_css.py +++ b/allianceauth/custom_css/templatetags/custom_css.py @@ -28,17 +28,16 @@ def custom_css_static(path: str) -> str: :rtype: """ - custom_css_changed = CustomCSS.objects.first().timestamp.timestamp() - custom_css_version = ( - str(custom_css_changed).replace(" ", "").replace(":", "").replace("-", "") - ) # remove spaces, colons, and dashes - static_url = static(path) - try: - Path(f"{settings.STATIC_ROOT}allianceauth/custom-styles.css").resolve(strict=True) + Path(f"{settings.STATIC_ROOT}{path}").resolve(strict=True) except FileNotFoundError: return "" else: + custom_css_changed = CustomCSS.objects.first().timestamp.timestamp() + custom_css_version = ( + str(custom_css_changed).replace(" ", "").replace(":", "").replace("-", "") + ) # remove spaces, colons, and dashes + static_url = static(path) versioned_url = static_url + "?v=" + custom_css_version return mark_safe(f'')