From a05e07b2dde89d935a3ba047162d4eb1d4b9309e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 31 Jan 2024 15:58:45 +1100 Subject: [PATCH] Disable cache for report helpers (#6370) (#6371) - Can lead to unintended consequences where REPORT_DEBUG_MODE toggles (cherry picked from commit 25573838921c13465bcfb8afdc7e2c030c298bab) Co-authored-by: Oliver --- InvenTree/report/templatetags/report.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/InvenTree/report/templatetags/report.py b/InvenTree/report/templatetags/report.py index 726703312d..091fab7bec 100644 --- a/InvenTree/report/templatetags/report.py +++ b/InvenTree/report/templatetags/report.py @@ -86,7 +86,7 @@ def asset(filename): filename = '' + filename # If in debug mode, return URL to the image, not a local file - debug_mode = InvenTreeSetting.get_setting('REPORT_DEBUG_MODE') + debug_mode = InvenTreeSetting.get_setting('REPORT_DEBUG_MODE', cache=False) # Test if the file actually exists full_path = settings.MEDIA_ROOT.joinpath('report', 'assets', filename).resolve() @@ -124,7 +124,7 @@ def uploaded_image(filename, replace_missing=True, replacement_file='blank_image filename = '' + filename # If in debug mode, return URL to the image, not a local file - debug_mode = InvenTreeSetting.get_setting('REPORT_DEBUG_MODE') + debug_mode = InvenTreeSetting.get_setting('REPORT_DEBUG_MODE', cache=False) # Check if the file exists if not filename: @@ -286,7 +286,7 @@ def logo_image(**kwargs): - Otherwise, return a path to the default InvenTree logo """ # If in debug mode, return URL to the image, not a local file - debug_mode = InvenTreeSetting.get_setting('REPORT_DEBUG_MODE') + debug_mode = InvenTreeSetting.get_setting('REPORT_DEBUG_MODE', cache=False) return InvenTree.helpers.getLogoImage(as_file=not debug_mode, **kwargs)