Skip to content

bug-1958218: upgrade django to v5.2.11#3283

Merged
biancadanforth merged 3 commits intomainfrom
bug-1958218
Feb 20, 2026
Merged

bug-1958218: upgrade django to v5.2.11#3283
biancadanforth merged 3 commits intomainfrom
bug-1958218

Conversation

@biancadanforth
Copy link
Contributor

@biancadanforth biancadanforth commented Feb 19, 2026

Because:

  • Django 4.2 LTS is hitting EOL in April 2026.
  • We need to upgrade to the next LTS, which is Django 5.2.
  • See upgrade plan for more information.

This PR:

  • Upgrades Django in a stepwise fashion from 4.2 -> 5.0 -> 5.2, checking for test failures at each step.
  • Fixes any test-related issues.

Notes:

@biancadanforth biancadanforth requested a review from a team as a code owner February 19, 2026 21:34
list_display_links = ["action_time", "get_change_message"]

def admin(self, obj):
def user_email(self, obj):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was shadowing the django.contrib.admin decorator, which was added below, leading to an error without renaming. It wasn't very descriptive in the first place.

app_name = "siteadmin"
urlpatterns = [
re_path("^sitestatus/$", admin.site_status, name="site_status"),
path("sitestatus/", admin.site_status, name="site_status"),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

path already handles anchoring paths at the beginning and end, so we don't need re_path.

def wrapper(request, *args, **kwargs):
trueish = ("1", "true", "yes")
debug = request.META.get("HTTP_DEBUG", "").lower() in trueish
debug = request.headers.get("debug", "").lower() in trueish
Copy link
Contributor Author

Choose a reason for hiding this comment

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

An easier and more readable equivalent.


class UploadByDownloadForm(forms.Form):
url = forms.URLField()
url = forms.URLField(assume_scheme="https")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added this to get rid of a deprecation warning for Django v6.0:

django.utils.deprecation.RemovedInDjango60Warning: The default scheme will be changed from 'http' to 'https' in Django 6.0. Pass the forms.URLField.assume_scheme argument to silence this warning, or set the FORMS_URLFIELD_ASSUME_HTTPS transitional setting to True to opt into using 'https' as the new default scheme.

This is fine, since we require the HTTPS scheme anyway further down.

# file, You can obtain one at https://mozilla.org/MPL/2.0/.


default_app_config = "tecken.apps.TeckenAppConfig"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This isn't needed anymore, as it will automatically discover the single AppConfig in tecken/apps.py.

Copy link
Contributor

@smarnach smarnach left a comment

Choose a reason for hiding this comment

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

Looks good to me.

I'm slightly puzzled why the PR removes a lot of wheel hashes for other platform (e.g. RISC-V and ARM). I thought we had already excluded those with the tools.uv.environments setting in pyproject.yaml, but for some reason they stuck around. It's good this PR removes them since we don't need them, but I don't know why they were there in the first place.

@biancadanforth
Copy link
Contributor Author

biancadanforth commented Feb 20, 2026

Looks good to me.

I'm slightly puzzled why the PR removes a lot of wheel hashes for other platform (e.g. RISC-V and ARM). I thought we had already excluded those with the tools.uv.environments setting in pyproject.yaml, but for some reason they stuck around. It's good this PR removes them since we don't need them, but I don't know why they were there in the first place.

Yeah I meant to mention that was unrelated to the Django upgrade. I made sure to use just uv lock (so I was using the uv install in the docker image) and did it again just to be sure. I don't see an explicit uv version number in the image, so maybe uv upgraded in the meantime and this changed with that upgrade?

@biancadanforth biancadanforth added this pull request to the merge queue Feb 20, 2026
Merged via the queue into main with commit 0e81313 Feb 20, 2026
1 check passed
@biancadanforth biancadanforth deleted the bug-1958218 branch February 20, 2026 14:55
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.

2 participants