Skip to content

Conversation

@pheus
Copy link
Contributor

@pheus pheus commented Sep 5, 2025

Fixes: #20234

Summary
The generic prerequisite include was passing request.path as the second positional argument to the add_button template tag. Because the tag expects (model, action, return_url), this caused request.path to be interpreted as action, breaking the "+ Add" link in banners such as "Before you can add a power feed you must first create a power panel."

Change
Pass the return_url by name so it’s bound correctly by the tag:

{% add_button prerequisite_model return_url=request.path %}

User impact
Clicking "+ Add" on any prerequisite banner now opens the correct add form and returns the user to the originating page upon completion.

Pass `return_url` by name; it was parsed as `action` in the generic
prerequisite include.

Fixes netbox-community#20234
@jeremystretch jeremystretch requested review from a team and jnovinger and removed request for a team September 5, 2025 12:47
@jnovinger jnovinger merged commit 47e4947 into netbox-community:main Sep 5, 2025
7 checks passed
@pheus pheus deleted the 20234-fix-missing-prerequisites-add-button branch September 5, 2025 13:01
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add button broken for "Before you can add a power feed you must first create a power panel."

2 participants