Fix bug where netmap views can't be saved or updated#3737
Merged
lunkwill42 merged 2 commits into5.16.xfrom Jan 28, 2026
Merged
Conversation
eb9808a to
d480f3d
Compare
|
Test results 27 files 27 suites 46m 17s ⏱️ Results for commit d480f3d. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 5.16.x #3737 +/- ##
==========================================
+ Coverage 63.03% 63.04% +0.01%
==========================================
Files 614 614
Lines 45438 45438
Branches 43 43
==========================================
+ Hits 28641 28646 +5
+ Misses 16787 16782 -5
Partials 10 10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
johannaengland
approved these changes
Jan 27, 2026
Contributor
johannaengland
left a comment
There was a problem hiding this comment.
Nice solution! Especially forward thinking with adding the function to be used in future cases!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Scope and purpose
Fixes #3736
This pull request
control_view.jsandmodels.js)/nodepositions/update/view, which seems to have been introduced in there_pathrefactor back in september (oops)The bug is solved by using a recommended approach for Django projects where AJAX calls are used in frontend code, i.e. https://docs.djangoproject.com/en/5.0/howto/csrf/. The bug is most likely caused by timing/rendering issues, where the dynamic rendering of the forms stops the csrf token from being added to the forms correctly. I added a new plugin
csrf-utilsthat can be re-used if we get similar issues elsewhere.Contributor Checklist
Every pull request should have this checklist filled out, no matter how small it is.
More information about contributing to NAV can be found in the
Hacker's guide to NAV.
<major>.<minor>.x). For a new feature or other additions, it should be based onmaster.