Skip to content

Backport login_not_required for Django < 5.1#3924

Merged
Simrayz merged 1 commit intomasterfrom
fix/backport-login-not-required
Mar 26, 2026
Merged

Backport login_not_required for Django < 5.1#3924
Simrayz merged 1 commit intomasterfrom
fix/backport-login-not-required

Conversation

@Simrayz
Copy link
Copy Markdown
Contributor

@Simrayz Simrayz commented Mar 25, 2026

Scope and purpose

Probably resolves PR #3917?

Backports Django 5.1's login_not_required decorator so that allauth views (login, OAuth callback, etc.) aren't blocked by AuthorizationMiddleware on Django < 5.1.

Screen Recording

dataporten-login-compressed.mp4

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.

  • Added a changelog fragment for towncrier
  • Added/amended tests for new/changed code
  • Added/changed documentation
  • Linted/formatted the code with ruff, easiest by using pre-commit
  • Wrote the commit message so that the first line continues the sentence "If applied, this commit will ...", starts with a capital letter, does not end with punctuation and is 50 characters or less long. See https://cbea.ms/git-commit/
  • Based this pull request on the correct upstream branch: For a patch/bugfix affecting the latest stable version, it should be based on that version's branch (<major>.<minor>.x). For a new feature or other additions, it should be based on master.
  • If applicable: Created new issues if this PR does not fix the issue completely/there is further work to be done
  • If it's not obvious from a linked issue, described how to interact with NAV in order for a reviewer to observe the effects of this change first-hand (commands, URLs, UI interactions)
  • If this results in changes in the UI: Added screenshots of the before and after
  • If this adds a new Python source code file: Added the boilerplate header to that file

@Simrayz Simrayz self-assigned this Mar 25, 2026
@Simrayz Simrayz requested review from a team and hmpf March 25, 2026 14:34
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 25, 2026

Test results

    13 files      13 suites   25m 10s ⏱️
 2 944 tests  2 944 ✅ 0 💤 0 ❌
17 220 runs  17 220 ✅ 0 💤 0 ❌

Results for commit 5712cf3.

♻️ This comment has been updated with latest results.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.99%. Comparing base (9660291) to head (f1f2bf4).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3924   +/-   ##
=======================================
  Coverage   63.98%   63.99%           
=======================================
  Files         627      627           
  Lines       46362    46368    +6     
  Branches       43       43           
=======================================
+ Hits        29667    29671    +4     
- Misses      16685    16687    +2     
  Partials       10       10           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Simrayz Simrayz marked this pull request as ready for review March 26, 2026 08:03
Copy link
Copy Markdown
Contributor

@hmpf hmpf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works.

@hmpf hmpf mentioned this pull request Mar 26, 2026
@Simrayz Simrayz force-pushed the fix/backport-login-not-required branch from 41a6d1e to 02a4e6f Compare March 26, 2026 10:18
Copy link
Copy Markdown
Contributor

@hmpf hmpf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct migration removed

Add changelog entry for login_not_required backport
@Simrayz Simrayz force-pushed the fix/backport-login-not-required branch from 5712cf3 to f1f2bf4 Compare March 26, 2026 12:06
@sonarqubecloud
Copy link
Copy Markdown

@Simrayz Simrayz merged commit 93e7d9c into master Mar 26, 2026
17 checks passed
@Simrayz Simrayz deleted the fix/backport-login-not-required branch March 26, 2026 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants