Skip to content

Mentally prepare for Django 5.2 upgrade#1507

Draft
sayravai wants to merge 1 commit intoapluslms:masterfrom
sayravai:Django5.2
Draft

Mentally prepare for Django 5.2 upgrade#1507
sayravai wants to merge 1 commit intoapluslms:masterfrom
sayravai:Django5.2

Conversation

@sayravai
Copy link
Contributor

@sayravai sayravai commented Mar 9, 2026

Description

Django 4.2 LTS support ends in April 2026, which is next month. We should upgrade all production Django projects to 5.2, so let's kick this off by this PR, which is essentially changes made by the django-upgrade script in the current a-plus repo.


# Redirect back to the previous page
return redirect(request.META.get('HTTP_REFERER', '/'))
return redirect(request.headers.get('referer', '/'))

Check warning

Code scanning / CodeQL

URL redirection from remote source Medium

Untrusted URL redirection depends on a
user-provided value
.

# Redirect back to the previous page
return redirect(request.META.get('HTTP_REFERER', '/'))
return redirect(request.headers.get('referer', '/'))

Check warning

Code scanning / CodeQL

URL redirection from remote source Medium

Untrusted URL redirection depends on a
user-provided value
.
pseudonymize = request.session.get("pseudonymize", False)
request.session["pseudonymize"] = not pseudonymize
return HttpResponseRedirect(request.META.get("HTTP_REFERER", "/"))
return HttpResponseRedirect(request.headers.get("referer", "/"))

Check warning

Code scanning / CodeQL

URL redirection from remote source Medium

Untrusted URL redirection depends on a
user-provided value
.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant