[PR #10747] [CLOSED] 10719 check ip permission on fhrpgroup form save #13681

Closed
opened 2025-12-29 23:20:14 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/10747
Author: @arthanson
Created: 10/25/2022
Status: Closed

Base: developHead: 10719-fhrpgroup-permission


📝 Commits (2)

  • 830a82f 10719 check ip permission on fhrpgroup form save
  • 766e9ff 10719 fix regression

📊 Changes

3 files changed (+28 additions, -20 deletions)

View changed files

📝 netbox/ipam/forms/models.py (+0 -20)
📝 netbox/ipam/views.py (+16 -0)
📝 netbox/netbox/views/generic/object_views.py (+12 -0)

📄 Description

Fixes: #10719

Moved the save / permission check out of the ipam form and into the view.
Created a save_related_data to make it more generic when using the generic edit form, otherwise would need to copy-pasta the whole post function.
This also showed an existing issue (fixed) where if the form got a permission error it would switch to an edit view (noticeable on the fhrpgroup form) as the obj.pk would be set even though the transaction would be rolled-back.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/10747 **Author:** [@arthanson](https://github.com/arthanson) **Created:** 10/25/2022 **Status:** ❌ Closed **Base:** `develop` ← **Head:** `10719-fhrpgroup-permission` --- ### 📝 Commits (2) - [`830a82f`](https://github.com/netbox-community/netbox/commit/830a82fa7e9590ef25c0a3f121d0992145bc423a) 10719 check ip permission on fhrpgroup form save - [`766e9ff`](https://github.com/netbox-community/netbox/commit/766e9ff31b1e2e79507d24da9ac557d24f0bf02b) 10719 fix regression ### 📊 Changes **3 files changed** (+28 additions, -20 deletions) <details> <summary>View changed files</summary> 📝 `netbox/ipam/forms/models.py` (+0 -20) 📝 `netbox/ipam/views.py` (+16 -0) 📝 `netbox/netbox/views/generic/object_views.py` (+12 -0) </details> ### 📄 Description <!-- Thank you for your interest in contributing to NetBox! Please note that our contribution policy requires that a feature request or bug report be approved and assigned prior to opening a pull request. This helps avoid waste time and effort on a proposed change that we might not be able to accept. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ISSUE WHICH HAS BEEN ASSIGNED TO YOU, IT WILL BE CLOSED AUTOMATICALLY. Please specify your assigned issue number on the line below. --> ### Fixes: #10719 <!-- Please include a summary of the proposed changes below. --> Moved the save / permission check out of the ipam form and into the view. Created a save_related_data to make it more generic when using the generic edit form, otherwise would need to copy-pasta the whole post function. This also showed an existing issue (fixed) where if the form got a permission error it would switch to an edit view (noticeable on the fhrpgroup form) as the obj.pk would be set even though the transaction would be rolled-back. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 23:20:14 +01:00
adam closed this issue 2025-12-29 23:20:15 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13681