Fix ModuleNotFoundError on plugin load: use relative resource paths
PluginConfig._load_resource() prepends self.__module__ (already
'netbox_rack_concept') to the configured path, so 'menu' and
'template_extensions' must be given relative to the plugin package
('navigation.menu', 'template_content.template_extensions'), not
prefixed with 'netbox_rack_concept.' again. The prefixed form made
Django try to import 'netbox_rack_concept.netbox_rack_concept...',
which doesn't exist, crashing manage.py on every command.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
1 parent
7b9b85776b
commit
66a9174859
1 file changed
+4
-2
@@ -12,8 +12,10 @@ class RackConceptConfig(PluginConfig):
|
||||
base_url = 'rack-concepts'
|
||||
min_version = '4.6.0'
|
||||
max_version = '4.6.99'
|
||||
menu = 'netbox_rack_concept.navigation.menu'
|
||||
template_extensions = 'netbox_rack_concept.template_content.template_extensions'
|
||||
# These paths are relative to this module (NetBox prepends self.__module__),
|
||||
# so they must NOT be prefixed with 'netbox_rack_concept.' again.
|
||||
menu = 'navigation.menu'
|
||||
template_extensions = 'template_content.template_extensions'
|
||||
|
||||
default_settings = {
|
||||
# Defaults used when a concept is created from scratch.
|
||||
|
||||
Reference in new issue
Block a user