summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2023-11-08 14:36:56 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2023-11-08 14:39:50 +0100
commit2883733d294d86541a7f9253d0f8bc3ff56ff8c9 (patch)
tree0a54f029a0a265ee864aac9b10324d191ece50a5
parentfe8275b4ff08a1e815c9cde6509fa466e148346e (diff)
downloadIshtar-2883733d294d86541a7f9253d0f8bc3ff56ff8c9.tar.bz2
Ishtar-2883733d294d86541a7f9253d0f8bc3ff56ff8c9.zip
🐛 Password expiration: delete cache after password reset
-rw-r--r--changelog/en/changelog_2022-06-15.md1
-rw-r--r--changelog/fr/changelog_2023-01-25.md1
-rw-r--r--ishtar_common/views.py4
3 files changed, 4 insertions, 2 deletions
diff --git a/changelog/en/changelog_2022-06-15.md b/changelog/en/changelog_2022-06-15.md
index 69e64a0ce..dd374655a 100644
--- a/changelog/en/changelog_2022-06-15.md
+++ b/changelog/en/changelog_2022-06-15.md
@@ -3,6 +3,7 @@ v4.0.63 - 2023-xx-xx
### Bug fixes ###
- Statistics: fix image display (#5650)
+- Password expiration: delete cache after password reset
v4.0.62 - 2023-10-27
--------------------
diff --git a/changelog/fr/changelog_2023-01-25.md b/changelog/fr/changelog_2023-01-25.md
index 5b69e7c8c..1a1529c04 100644
--- a/changelog/fr/changelog_2023-01-25.md
+++ b/changelog/fr/changelog_2023-01-25.md
@@ -3,6 +3,7 @@ v4.0.63 - 2023-xx-xx
### Corrections de dysfonctionnements ###
- Statistiques: correction de l'affichage image (#5650)
+- Expiration du mot de passe : suppression du cache après la réinitialisation du mot de passe
v4.0.62 - 2023-10-27
--------------------
diff --git a/ishtar_common/views.py b/ishtar_common/views.py
index 2a60bfd6a..2ab7e970d 100644
--- a/ishtar_common/views.py
+++ b/ishtar_common/views.py
@@ -203,8 +203,8 @@ def update_password_last_update(user):
return
ishtar_user.password_last_update = datetime.date.today()
ishtar_user.save()
- key = f"{settings.PROJECT_SLUG}-password_expired-{ishtar_user.pk}"
- cache.set(key, False, settings.CACHE_TIMEOUT)
+ key = f"{settings.PROJECT_SLUG}-password_expired-{user.pk}"
+ cache.delete(key)
class PasswordChangeView(auth_view.PasswordChangeView):