Return URL is not preserved when using "create and add another" button #5795

Closed
opened 2025-12-29 19:32:45 +01:00 by adam · 5 comments
Owner

Originally created by @candlerb on GitHub (Dec 17, 2021).

Originally assigned to: @jeremystretch on GitHub.

NetBox version

v3.1.1

Python version

3.8

Steps to Reproduce

  1. Create a device with an interface, say IP 192.168.5.1/24
  2. Create FHRP group ID 1, with address 192.168.5.2/24, status Active, "Create and add another"
  3. Create FHRP group ID 2, with address 192.168.5.3/24, status Active, "Create"
  4. Go to the device, view the interface
  5. Click "Assign group". Click "Cancel". This correctly returns to the interface.
  6. Click "Assign group". Select group ID 1, priority 0, click "Create and add another"
  7. Click "Cancel"

Expected Behavior

Return to the interface page (/dcim/interfaces/NNN/)

Observed Behavior

Returns to the Netbox home page. It has forgotten the navigation route to the correct place

Originally created by @candlerb on GitHub (Dec 17, 2021). Originally assigned to: @jeremystretch on GitHub. ### NetBox version v3.1.1 ### Python version 3.8 ### Steps to Reproduce 1. Create a device with an interface, say IP 192.168.5.1/24 2. Create FHRP group ID 1, with address 192.168.5.2/24, status Active, "Create and add another" 3. Create FHRP group ID 2, with address 192.168.5.3/24, status Active, "Create" 4. Go to the device, view the interface 5. Click "Assign group". Click "Cancel". This correctly returns to the interface. 6. Click "Assign group". Select group ID 1, priority 0, click "Create and add another" 6. Click "Cancel" ### Expected Behavior Return to the interface page (`/dcim/interfaces/NNN/`) ### Observed Behavior Returns to the Netbox home page. It has forgotten the navigation route to the correct place
adam added the type: bugstatus: accepted labels 2025-12-29 19:32:46 +01:00
adam closed this issue 2025-12-29 19:32:46 +01:00
Author
Owner

@jeremystretch commented on GitHub (Dec 20, 2021):

I'm not able to replicate this on v3.1.1. After assigning the FHRP group, I'm redirected to the interface view via a 302 response as expected.

Can you inspect the form submission in the browser when assigning the group to verify whether the return_url value is being passed?

@jeremystretch commented on GitHub (Dec 20, 2021): I'm not able to replicate this on v3.1.1. After assigning the FHRP group, I'm redirected to the interface view via a 302 response as expected. Can you inspect the form submission in the browser when assigning the group to verify whether the `return_url` value is being passed?
Author
Owner

@DanSheps commented on GitHub (Dec 20, 2021):

You need to assign the first group, then the return_url on the cancel button does not properly populate.

Additionally, it looks like it populates the wrong return_url on the "create group" button

@DanSheps commented on GitHub (Dec 20, 2021): You need to assign the first group, then the return_url on the cancel button does not properly populate. Additionally, it looks like it populates the wrong return_url on the "create group" button
Author
Owner

@jeremystretch commented on GitHub (Dec 20, 2021):

Ah, my mistake. I think I was clicking "create" instead.

@jeremystretch commented on GitHub (Dec 20, 2021): Ah, my mistake. I think I was clicking "create" instead.
Author
Owner

@jeremystretch commented on GitHub (Dec 20, 2021):

This doesn't seem to be related to FHRP groups specifically, but rather ObjectEditView in general.

@jeremystretch commented on GitHub (Dec 20, 2021): This doesn't seem to be related to FHRP groups specifically, but rather ObjectEditView in general.
Author
Owner

@jeremystretch commented on GitHub (Dec 20, 2021):

This looks like a regression introduced in b95773938d

@jeremystretch commented on GitHub (Dec 20, 2021): This looks like a regression introduced in b95773938d50acdb5404a63c346ca93bee5fdbb9
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5795