2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-01 03:00:54 +00:00

Improvements for panel mixin sample

This commit is contained in:
Oliver Walters
2022-05-06 23:19:47 +10:00
parent 0797e9ebf0
commit 12c58b14d6
3 changed files with 19 additions and 6 deletions

View File

@ -606,18 +606,18 @@ class PanelMixin:
for panel in self.get_custom_panels(view, request):
if 'content_template' in panel:
# TODO: Render the actual content
# TODO: Render the actual HTML content from a template file
...
if 'javascript_template' in panel:
# TODO: Render the actual content
# TODO: Render the actual javascript content from a template file
...
# Check for required keys
required_keys = ['title', 'content']
if any([key not in panel for key in required_keys]):
logger.warning(f"Custom panel for plugin '{__class__}' is missing a required key")
logger.warning(f"Custom panel for plugin {__class__} is missing a required parameter")
continue
# Add some information on this plugin