You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a plugin with name set to myplugin but in its PluginConfig do not define a base_url
Create a model and standard API viewset in the plugin
Navigate to the /api/plugins/ endpoint
Expected Behavior
The response should contain the hyperlink to the plugin's root view with the key myplugin
Observed Behavior
The plugin's hyperlink key is null.
This is caused because nautobot.extras.plugins.PluginConfig defines base_url = None and nautobot.extras.plugins.api.views.PluginsAPIRootView incorrectly checks if base_url has been define in the plugin's config. See
Environment
Steps to Reproduce
name
set tomyplugin
but in itsPluginConfig
do not define abase_url
/api/plugins/
endpointExpected Behavior
The response should contain the hyperlink to the plugin's root view with the key
myplugin
Observed Behavior
The plugin's hyperlink key is
null
.This is caused because
nautobot.extras.plugins.PluginConfig
definesbase_url = None
andnautobot.extras.plugins.api.views.PluginsAPIRootView
incorrectly checks ifbase_url
has been define in the plugin's config. Seenautobot/nautobot/extras/plugins/__init__.py
Line 41 in ac1768a
nautobot/nautobot/extras/plugins/views.py
Line 72 in ac1768a
The
base_url
attribute is actually defined but it isNone
solabel
is never actually considered. We just need to adjust this logic.The text was updated successfully, but these errors were encountered: