Skip to content

Commit

Permalink
requirements: Djando 5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tonial committed Oct 29, 2024
1 parent 1d21e89 commit ad0475f
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 12 deletions.
1 change: 1 addition & 0 deletions inclusion_connect/users/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def __init__(self, user, *args, **kwargs):
super().__init__(*args, **kwargs)

def clean_password(self):
self.cleaned_data["set_usable_password"] = True
password = self.cleaned_data.get("password")
password_validation.validate_password(password, self.user)
return password
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ psycopg[binary] # https://github.com/psycopg/psycopg
# Django
# ------------------------------------------------------------------------------

django==5.0.* # https://www.djangoproject.com/
django==5.1.* # https://www.djangoproject.com/

django-oauth-toolkit # https://github.com/jazzband/django-oauth-toolkit

Expand Down
6 changes: 3 additions & 3 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@ dj-database-url==2.2.0 \
--hash=sha256:3e792567b0aa9a4884860af05fe2aa4968071ad351e033b6db632f97ac6db9de \
--hash=sha256:9f9b05058ddf888f1e6f840048b8d705ff9395e3b52a07165daa3d8b9360551b
# via -r requirements/base.in
django==5.0.9 \
--hash=sha256:6333870d342329b60174da3a60dbd302e533f3b0bb0971516750e974a99b5a39 \
--hash=sha256:f219576ba53be4e83f485130a7283f0efde06a9f2e3a7c3c5180327549f078fa
django==5.1.2 \
--hash=sha256:bd7376f90c99f96b643722eee676498706c9fd7dc759f55ebfaf2c08ebcdf4f0 \
--hash=sha256:f11aa87ad8d5617171e3f77e1d5d16f004b79a2cf5d2e1d2b97a6a1f8e9ba5ed
# via
# -r requirements/base.in
# dj-database-url
Expand Down
6 changes: 3 additions & 3 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,9 @@ dj-database-url==2.2.0 \
--hash=sha256:3e792567b0aa9a4884860af05fe2aa4968071ad351e033b6db632f97ac6db9de \
--hash=sha256:9f9b05058ddf888f1e6f840048b8d705ff9395e3b52a07165daa3d8b9360551b
# via -r requirements/base.txt
django==5.0.9 \
--hash=sha256:6333870d342329b60174da3a60dbd302e533f3b0bb0971516750e974a99b5a39 \
--hash=sha256:f219576ba53be4e83f485130a7283f0efde06a9f2e3a7c3c5180327549f078fa
django==5.1.2 \
--hash=sha256:bd7376f90c99f96b643722eee676498706c9fd7dc759f55ebfaf2c08ebcdf4f0 \
--hash=sha256:f11aa87ad8d5617171e3f77e1d5d16f004b79a2cf5d2e1d2b97a6a1f8e9ba5ed
# via
# -r requirements/base.txt
# dj-database-url
Expand Down
2 changes: 1 addition & 1 deletion tests/__snapshots__/test_template_tags.ambr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# serializer version: 1
# name: test_new_password_display[new password has instructions]
'''
<div class="mb-3 form-group-required"><label class="form-label" for="id_password1">Mot de passe</label><div class="input-group"><input aria-describedby="id_password1_helptext" autocomplete="new-password" class="form-control password-with-instructions" id="id_password1" name="password1" placeholder="**********" required="" type="password"/>
<div class="mb-3"><label class="form-label" for="id_password1">Mot de passe</label><div class="input-group"><input aria-describedby="id_password1_helptext" autocomplete="new-password" class="form-control password-with-instructions" id="id_password1" name="password1" placeholder="**********" type="password"/>
<span class="input-group-text p-0">
<button class="btn btn-sm btn-link btn-ico" data-it-password="toggle" type="button">
<i class="ri-eye-line"></i>
Expand Down
4 changes: 2 additions & 2 deletions tests/users/__snapshots__/test_admin.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@
<tbody>


<tr><td class="action-checkbox"><input aria-label="Choisir cet objet pour une action - Alice Adam" class="action-select" name="_selected_action" type="checkbox" value="11111111-1111-1111-1111-111111111111"/></td><th class="field-username"><a href="/admin/users/user/11111111-1111-1111-1111-111111111111/change/?_changelist_filters=q%3Da.a">11111111-1111-1111-1111-111111111111</a></th><td class="field-email"></td><td class="field-email_to_validate">[email protected]</td><td class="field-first_name">Alice</td><td class="field-last_name">Adam</td><td class="field-federation">-</td><td class="field-is_staff"><img alt="False" src="/static/admin/img/icon-no.svg"/></td></tr>
<tr><td class="action-checkbox"><input aria-label="Choisir cet objet pour une action - Alice Adam" class="action-select" name="_selected_action" type="checkbox" value="11111111-1111-1111-1111-111111111111"/></td><th class="field-username"><a href="/admin/users/user/11111111-1111-1111-1111-111111111111/change/?_changelist_filters=q%3Da.a">11111111-1111-1111-1111-111111111111</a></th><td class="field-email">-</td><td class="field-email_to_validate">[email protected]</td><td class="field-first_name">Alice</td><td class="field-last_name">Adam</td><td class="field-federation">-</td><td class="field-is_staff"><img alt="False" src="/static/admin/img/icon-no.svg"/></td></tr>

</tbody>
</table>
Expand Down Expand Up @@ -550,7 +550,7 @@
<tbody>


<tr><td class="action-checkbox"><input aria-label="Choisir cet objet pour une action - Alice Adam" class="action-select" name="_selected_action" type="checkbox" value="11111111-1111-1111-1111-111111111111"/></td><th class="field-username"><a href="/admin/users/user/11111111-1111-1111-1111-111111111111/change/?_changelist_filters=q%3DmAiLiNaToR">11111111-1111-1111-1111-111111111111</a></th><td class="field-email"></td><td class="field-email_to_validate">[email protected]</td><td class="field-first_name">Alice</td><td class="field-last_name">Adam</td><td class="field-federation">-</td><td class="field-is_staff"><img alt="False" src="/static/admin/img/icon-no.svg"/></td></tr>
<tr><td class="action-checkbox"><input aria-label="Choisir cet objet pour une action - Alice Adam" class="action-select" name="_selected_action" type="checkbox" value="11111111-1111-1111-1111-111111111111"/></td><th class="field-username"><a href="/admin/users/user/11111111-1111-1111-1111-111111111111/change/?_changelist_filters=q%3DmAiLiNaToR">11111111-1111-1111-1111-111111111111</a></th><td class="field-email">-</td><td class="field-email_to_validate">[email protected]</td><td class="field-first_name">Alice</td><td class="field-last_name">Adam</td><td class="field-federation">-</td><td class="field-is_staff"><img alt="False" src="/static/admin/img/icon-no.svg"/></td></tr>


<tr><td class="action-checkbox"><input aria-label="Choisir cet objet pour une action - Bob Bear — [email protected]" class="action-select" name="_selected_action" type="checkbox" value="22222222-2222-2222-2222-222222222222"/></td><th class="field-username"><a href="/admin/users/user/22222222-2222-2222-2222-222222222222/change/?_changelist_filters=q%3DmAiLiNaToR">22222222-2222-2222-2222-222222222222</a></th><td class="field-email">[email protected]</td><td class="field-email_to_validate">-</td><td class="field-first_name">Bob</td><td class="field-last_name">Bear</td><td class="field-federation">-</td><td class="field-is_staff"><img alt="False" src="/static/admin/img/icon-no.svg"/></td></tr>
Expand Down
6 changes: 4 additions & 2 deletions tests/users/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,13 +755,15 @@ def test_superuser_can_promote_user(self, client):
response = client.get(response.url)
assertContains(
response,
'<select name="groups" aria-describedby="id_groups_helptext" id="id_groups" multiple class="selectfilter" '
'<select name="groups" data-context="available-source" aria-describedby="id_groups_helptext" '
'id="id_groups" multiple class="selectfilter" '
'data-field-name="groupes" data-is-stacked="0">',
count=1,
)
assertContains(
response,
'<select name="user_permissions" aria-describedby="id_user_permissions_helptext" id="id_user_permissions" '
'<select name="user_permissions" data-context="available-source" '
'aria-describedby="id_user_permissions_helptext" id="id_user_permissions" '
'multiple class="selectfilter" data-field-name="permissions de l’utilisateur" data-is-stacked="0">',
count=1,
)
Expand Down

0 comments on commit ad0475f

Please sign in to comment.