Skip to content

Commit

Permalink
Merge Mailu#3423
Browse files Browse the repository at this point in the history
3423: Fix Mailu#3411 r=mergify[bot] a=nextgens

## What type of PR?

bug-fix

## What does this PR do?

Ensure we don't nuke all web-sessions when a password is changed.
This was reported with the command line but I suspect the API is affected too.

### Related issue(s)
- close Mailu#3411 

## Prerequisites
Before we can consider review and merge, please make sure the following list is done and checked.
If an entry in not applicable, you can check it or remove it from the list.

- [ ] In case of feature or enhancement: documentation updated accordingly
- [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file.


Co-authored-by: Florent Daigniere <nextgens@freenetproject.org>
  • Loading branch information
bors-mailu[bot] and nextgens authored Sep 9, 2024
2 parents 8ed0268 + 63769c7 commit 0db6e41
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion core/admin/mailu/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ def set_password(self, password, raw=False, keep_sessions=None):
set() containing the sessions to keep
"""
self.password = password if raw else User.get_password_context().hash(password)
if keep_sessions is not True:
if keep_sessions is not True and self.email is not None:
utils.MailuSessionExtension.prune_sessions(uid=self.email, keep=keep_sessions)

def get_managed_domains(self):
Expand Down
1 change: 1 addition & 0 deletions towncrier/newsfragments/3411.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Ensure we do not nuke all web-sessions when a password is changed using the command line

0 comments on commit 0db6e41

Please sign in to comment.