From d607495e4b631131ce78f36d8e2f58d4a742d11b Mon Sep 17 00:00:00 2001 From: s3lph Date: Fri, 8 Feb 2019 04:53:45 +0100 Subject: [PATCH 1/2] Fixed: Error 500 on password change when old password didn't match. --- matemat/webserver/pagelets/admin.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/matemat/webserver/pagelets/admin.py b/matemat/webserver/pagelets/admin.py index 7e4f95e..40046eb 100644 --- a/matemat/webserver/pagelets/admin.py +++ b/matemat/webserver/pagelets/admin.py @@ -10,7 +10,7 @@ from matemat.webserver import pagelet, RequestArguments, PageletResponse, Redire from matemat.util.currency_format import parse_chf from matemat.db import MatematDatabase from matemat.db.primitives import User, ReceiptPreference -from matemat.exceptions import DatabaseConsistencyError, HttpException +from matemat.exceptions import AuthenticationError, DatabaseConsistencyError, HttpException @pagelet('/admin') @@ -101,7 +101,10 @@ def handle_change(args: RequestArguments, user: User, db: MatematDatabase, confi if newpass != newpass2: raise ValueError('New passwords don\'t match') # Write the new password to the database - db.change_password(user, oldpass, newpass) + try: + db.change_password(user, oldpass, newpass) + except AuthenticationError: + raise ValueError('Old password doesn\'t match') # The user requested a touchkey change elif change == 'touchkey': From 9006495aecfa6f518c5af5bd6fb50baeb4363999 Mon Sep 17 00:00:00 2001 From: s3lph Date: Fri, 8 Feb 2019 05:01:44 +0100 Subject: [PATCH 2/2] Updated Matemat version to 0.1.1 --- CHANGELOG.md | 14 ++++++++++++++ matemat/__init__.py | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a5b5b47..60e748f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Matemat Changelog + +## Version 0.1.1 + +Minor bugfix release. + +### Changes + + +- Fixed: 500 Error when attempting to change the password with a wrong old password. + + + + + ## Version 0.1 diff --git a/matemat/__init__.py b/matemat/__init__.py index 373d726..6655893 100644 --- a/matemat/__init__.py +++ b/matemat/__init__.py @@ -1,2 +1,2 @@ -__version__ = '0.1' +__version__ = '0.1.1'