Skip to content

Commit 667bf22

Browse files
ulgensbmispelon
andauthored
Updated Django dependency to version 5.1.5
Co-authored-by: Baptiste Mispelon <[email protected]>
1 parent 336ddcc commit 667bf22

File tree

9 files changed

+7
-55
lines changed

9 files changed

+7
-55
lines changed

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ repos:
3636
rev: "1.22.2"
3737
hooks:
3838
- id: django-upgrade
39-
args: [--target-version, "5.0"]
39+
args: [--target-version, "5.1"]
4040
- repo: https://github.com/psf/black
4141
rev: 24.10.0
4242
hooks:

accounts/hashers.py

-12
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
from django.db import migrations
22

3-
from ..hashers import PBKDF2WrappedSHA1PasswordHasher
4-
5-
6-
def forwards_func(apps, schema_editor):
7-
User = apps.get_model("auth", "User")
8-
users = User.objects.filter(password__startswith="sha1$")
9-
hasher = PBKDF2WrappedSHA1PasswordHasher()
10-
for user in users:
11-
algorithm, salt, sha1_hash = user.password.split("$", 2)
12-
user.password = hasher.encode_sha1_hash(sha1_hash, salt)
13-
user.save(update_fields=["password"])
14-
153

164
class Migration(migrations.Migration):
175

@@ -21,5 +9,6 @@ class Migration(migrations.Migration):
219
]
2210

2311
operations = [
24-
migrations.RunPython(forwards_func),
12+
# See git history of this file for why this migration is empty
13+
migrations.RunPython(migrations.RunPython.noop),
2514
]

accounts/test_hashers.py

-21
This file was deleted.

aggregator/migrations/0004_add_local_django_community.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ class Migration(migrations.Migration):
2929
),
3030
migrations.AddConstraint(
3131
model_name='localdjangocommunity',
32-
constraint=models.CheckConstraint(check=models.Q(models.Q(('event_site_url__isnull', False), ('website_url__isnull', False)), models.Q(('event_site_url__isnull', False), ('website_url__isnull', True)), models.Q(('event_site_url__isnull', True), ('website_url__isnull', False)), _connector='OR'), name='website_url_and_or_event_site_url'),
32+
constraint=models.CheckConstraint(condition=models.Q(models.Q(('event_site_url__isnull', False), ('website_url__isnull', False)), models.Q(('event_site_url__isnull', False), ('website_url__isnull', True)), models.Q(('event_site_url__isnull', True), ('website_url__isnull', False)), _connector='OR'), name='website_url_and_or_event_site_url'),
3333
),
3434
]

aggregator/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ class Meta:
229229
verbose_name_plural = _("Local Django Communities")
230230
constraints = [
231231
models.CheckConstraint(
232-
check=(
232+
condition=(
233233
models.Q(website_url__isnull=False, event_site_url__isnull=False)
234234
| models.Q(website_url__isnull=True, event_site_url__isnull=False)
235235
| models.Q(website_url__isnull=False, event_site_url__isnull=True)

djangoproject/settings/common.py

-5
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,6 @@
157157
"django_hosts.middleware.HostsResponseMiddleware",
158158
]
159159

160-
PASSWORD_HASHERS = [
161-
"django.contrib.auth.hashers.PBKDF2PasswordHasher",
162-
"accounts.hashers.PBKDF2WrappedSHA1PasswordHasher",
163-
]
164-
165160
ROOT_URLCONF = "djangoproject.urls.www"
166161

167162
SECRET_KEY = str(SECRETS["secret_key"])

requirements/common.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ django-push @ git+https://github.com/brutasse/django-push.git@22fda99641cfbd2f30
77
django-read-only==1.18.0
88
django-recaptcha==4.0.0
99
django-registration-redux==2.13
10-
Django==5.0.11
10+
Django==5.1.5
1111
docutils==0.21.2
1212
feedparser==6.0.11
1313
Jinja2==3.1.5

tracdb/testutils.py

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def _replace_primary_key_field_with_autofield(model, schema_editor):
3636
new `testid` autofield. This makes the models easier to manipulate in the tests.
3737
"""
3838
old_pk_field = _get_pk_field(model)
39+
del old_pk_field.unique
3940
new_pk_field = deepcopy(old_pk_field)
4041
new_pk_field.primary_key = False
4142
schema_editor.alter_field(

0 commit comments

Comments
 (0)