From 51cece9e07da854c11a52c5c9ca56719713fce25 Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 15 Jun 2023 18:59:50 +1000 Subject: [PATCH] custom panel fix (#5049) - Handle case where get_custom_panels returns None --- InvenTree/plugin/base/integration/mixins.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/InvenTree/plugin/base/integration/mixins.py b/InvenTree/plugin/base/integration/mixins.py index e4978ab6a2..c969d65f61 100644 --- a/InvenTree/plugin/base/integration/mixins.py +++ b/InvenTree/plugin/base/integration/mixins.py @@ -467,7 +467,9 @@ class PanelMixin: # Construct an updated context object for template rendering ctx = self.get_panel_context(view, request, context) - for panel in self.get_custom_panels(view, request): + custom_panels = self.get_custom_panels(view, request) or [] + + for panel in custom_panels: content_template = panel.get('content_template', None) javascript_template = panel.get('javascript_template', None)