mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-05-06 13:01:50 +02:00
Only update password if changed to prevent spurious log entries
This commit is contained in:
parent
745c3fb8b5
commit
71c12b562d
1 changed files with 6 additions and 2 deletions
|
@ -14,7 +14,7 @@ from flask_wtf.file import FileField, FileAllowed, FileRequired
|
||||||
|
|
||||||
from flask_babel import lazy_gettext as _
|
from flask_babel import lazy_gettext as _
|
||||||
from flask import request
|
from flask import request
|
||||||
from werkzeug.security import generate_password_hash
|
from werkzeug.security import generate_password_hash, check_password_hash
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from re import match
|
from re import match
|
||||||
|
@ -113,7 +113,11 @@ class EditProjectForm(FlaskForm):
|
||||||
def update(self, project):
|
def update(self, project):
|
||||||
"""Update the project with the information from the form"""
|
"""Update the project with the information from the form"""
|
||||||
project.name = self.name.data
|
project.name = self.name.data
|
||||||
|
|
||||||
|
# Only update password if changed to prevent spurious log entries
|
||||||
|
if not check_password_hash(project.password, self.password.data):
|
||||||
project.password = generate_password_hash(self.password.data)
|
project.password = generate_password_hash(self.password.data)
|
||||||
|
|
||||||
project.contact_email = self.contact_email.data
|
project.contact_email = self.contact_email.data
|
||||||
project.logging_preference = self.logging_preferences.data
|
project.logging_preference = self.logging_preferences.data
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue