From 2d05221a0bb76801fec147d725674faabeb0341a Mon Sep 17 00:00:00 2001 From: Paolo Melchiorre Date: Tue, 5 Nov 2024 23:19:05 +0100 Subject: [PATCH] Updated to Django 5.0. --- .pre-commit-config.yaml | 2 +- blog/models.py | 2 +- djangoproject/settings/common.py | 2 ++ members/test_admin.py | 4 ++-- requirements/common.txt | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 43144f2da..e554646f3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -35,7 +35,7 @@ repos: rev: "1.22.1" hooks: - id: django-upgrade - args: [--target-version, "4.2"] + args: [--target-version, "5.0"] - repo: https://github.com/psf/black rev: 24.10.0 hooks: diff --git a/blog/models.py b/blog/models.py index 646ad2ad5..8aa8231a1 100644 --- a/blog/models.py +++ b/blog/models.py @@ -83,7 +83,7 @@ class Entry(models.Model): "publication date must be in the past." ), ) - content_format = models.CharField(choices=ContentFormat.choices, max_length=50) + content_format = models.CharField(choices=ContentFormat, max_length=50) summary = models.TextField() summary_html = models.TextField() body = models.TextField() diff --git a/djangoproject/settings/common.py b/djangoproject/settings/common.py index f77cbdbd7..8b2bf0363 100644 --- a/djangoproject/settings/common.py +++ b/djangoproject/settings/common.py @@ -306,3 +306,5 @@ TRAC_URL = "https://code.djangoproject.com/" DEFAULT_AUTO_FIELD = "django.db.models.AutoField" + +FORMS_URLFIELD_ASSUME_HTTPS = True diff --git a/members/test_admin.py b/members/test_admin.py index b21db5754..29fffd49c 100644 --- a/members/test_admin.py +++ b/members/test_admin.py @@ -61,12 +61,12 @@ def test_status_filter(self): StatusFilter(**filter_args).queryset(request=None, queryset=members), [self.member], ) - filter_args["params"] = {"status": "inactive"} + filter_args["params"] = {"status": ["inactive"]} self.assertCountEqual( StatusFilter(**filter_args).queryset(None, CorporateMember.objects.all()), [self.inactive_member], ) - filter_args["params"] = {"status": "all"} + filter_args["params"] = {"status": ["all"]} self.assertCountEqual( StatusFilter(**filter_args).queryset(None, CorporateMember.objects.all()), [self.member, self.inactive_member], diff --git a/requirements/common.txt b/requirements/common.txt index 73e5cade6..93793d5b5 100644 --- a/requirements/common.txt +++ b/requirements/common.txt @@ -7,7 +7,7 @@ django-push @ git+https://github.com/brutasse/django-push.git@22fda99641cfbd2f30 django-read-only==1.18.0 django-recaptcha==4.0.0 django-registration-redux==2.13 -Django==4.2.16 +Django==5.0.9 docutils==0.21.2 feedparser==6.0.11 Jinja2==3.1.4