2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-19 05:25:42 +00:00

Bypass cache when displaying settings on "settings" page (#4499)

* Bypass cache when displaying settings on "settings" page

- Sometimes caching issues can cause "old" values to be stored (depends on the worker)
- Until we have a shared cache, this is a problem
- Force the settings to be re-loaded from the database when displaying
- Further improvement would be to render them via the API

* Bypass cache for report and label printing

* Update test

(cherry picked from commit 18c7c1d756)
This commit is contained in:
Oliver
2023-03-16 19:55:07 +11:00
committed by GitHub
parent 324a47ba17
commit 16ff1936cd
5 changed files with 17 additions and 14 deletions

View File

@ -185,7 +185,7 @@ class LabelPrintMixin(LabelFilterMixin):
outputs = []
# In debug mode, generate single HTML output, rather than PDF
debug_mode = common.models.InvenTreeSetting.get_setting('REPORT_DEBUG_MODE')
debug_mode = common.models.InvenTreeSetting.get_setting('REPORT_DEBUG_MODE', cache=False)
label_name = "label.pdf"
@ -260,7 +260,7 @@ class LabelPrintMixin(LabelFilterMixin):
pdf = outputs[0].get_document().copy(pages).write_pdf()
inline = common.models.InvenTreeUserSetting.get_setting('LABEL_INLINE', user=request.user)
inline = common.models.InvenTreeUserSetting.get_setting('LABEL_INLINE', user=request.user, cache=False)
return InvenTree.helpers.DownloadFile(
pdf,