mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-15 17:31:26 +00:00
* add mixin order ref
* move import
* fix import order
* reorder import
* move activation/deactivation to mixins
* move loaded/unloaded mixins out into seperate modules
* fix deactivation sequence
* switch to classmethods for loading
* only run (de)activation if defined for mixin
Fixes #4184
* fix deactivating
* move reloading back to registry
* fix merge error
* move app mixin deactivation
* fix migration reloading
* reverse deactivation sequence
* Revert "reverse deactivation sequence"
This reverts commit aff17dd07d
.
19 lines
467 B
Python
19 lines
467 B
Python
"""URL lookup for plugin app."""
|
|
|
|
from django.urls import include, re_path
|
|
|
|
PLUGIN_BASE = 'plugin' # Constant for links
|
|
|
|
|
|
def get_plugin_urls():
|
|
"""Returns a urlpattern that can be integrated into the global urls."""
|
|
from plugin import registry
|
|
|
|
urls = []
|
|
|
|
for plugin in registry.plugins.values():
|
|
if plugin.mixin_enabled('urls'):
|
|
urls.append(plugin.urlpatterns)
|
|
|
|
return re_path(f'^{PLUGIN_BASE}/', include((urls, 'plugin')))
|