-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add UI URL pattern for scripts to allow a specific script to be accessed by module and class in addition to ID #18024
Comments
Ah excellent, have just come across the same issue when evaluating an upgrade from v3.7.8. Seems it might be a capability regression introduced in v4.0.0. For us, it breaks navigation on dependent Custom Links, Export Templates and Custom Scripts where URLs are constructed. I have only just started digging, but comparing the v4.2.3 (current) /netbox/extras/urls.py [ From Line 74 ]
v3.7.8 /netbox/extras/urls.py [ From Line 128 ]
IIRC, the URL path also changed between v2 and v3, from |
I encountered this exact issue when evaluating an upgrade from 3.7.8 to 4 .. would be great to get the /scripts/module/name url back again! |
I can work on this. |
…e.name (#18723) * Add URL pattern for scripts to reference them by module.name * Change _get_script function name and syntax * Fix formatting issue
NetBox version
v4.1.6
Feature type
New functionality
Triage priority
I volunteer to perform this work (if approved)
Proposed functionality
Related to #16145, proposing to allow a URL pattern for scripts to reference them by
<module>.<class>
. The scope of this request is simply to allow this new URL pattern in addition to the existingscripts/<int:pk>/
,scripts/<int:pk>/source/
, andscripts/<int:pk>/jobs/
patterns. The templates andScript.get_absolute_url()
would still reference the pk. The suggested URL pattern should match the allowed pattern for the API resolved in #16145.Use case
When using Custom Links to link to a specific script, using the pk is problematic because it's subject to change as the scripts are updated over time. By allowing the
<module>.<class>
pattern, the custom links could be configured to use that pattern and return the correct script.Database changes
None
External dependencies
None
The text was updated successfully, but these errors were encountered: