bug-1958218: upgrade django to v5.2.11#3283
Conversation
| list_display_links = ["action_time", "get_change_message"] | ||
|
|
||
| def admin(self, obj): | ||
| def user_email(self, obj): |
There was a problem hiding this comment.
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"), |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
An easier and more readable equivalent.
|
|
||
| class UploadByDownloadForm(forms.Form): | ||
| url = forms.URLField() | ||
| url = forms.URLField(assume_scheme="https") |
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
This isn't needed anymore, as it will automatically discover the single AppConfig in tecken/apps.py.
smarnach
left a comment
There was a problem hiding this comment.
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 |
Because:
This PR:
Notes:
django-upgradewith a target version of 5.0 as part of working on the first upgrade step from 4.2 to 5.0. It largely made changes to some files to use newer but equivalent ways of doing things.