2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-30 18:50:53 +00:00

Adds a new "Panel" mixin which can render custom panels on given pages

- Adds item to sidebar menu
- Adds panel content
- Runs custom javascript when the page is loaded
This commit is contained in:
Oliver Walters
2022-05-06 22:49:51 +10:00
parent 28e16616e5
commit 7b8a10173d
3 changed files with 112 additions and 15 deletions

View File

@ -307,14 +307,17 @@ class PluginsRegistry:
# TODO check more stuff -> as of Nov 2021 there are not many checks in place
# but we could enhance those to check signatures, run the plugin against a whitelist etc.
logger.info(f'Loading integration plugin {plugin.PLUGIN_NAME}')
try:
plugin = plugin()
except Exception as error:
# log error and raise it -> disable plugin
handle_error(error, log_name='init')
logger.info(f'Loaded integration plugin {plugin.slug}')
logger.debug(f'Loaded integration plugin {plugin.PLUGIN_NAME}')
plugin.is_package = was_packaged
if plugin_db_setting:
plugin.pk = plugin_db_setting.pk