diff options
| author | Thibaut Horel <thibaut.horel@gmail.com> | 2015-05-22 23:36:55 +0200 |
|---|---|---|
| committer | Thibaut Horel <thibaut.horel@gmail.com> | 2015-05-22 23:38:16 +0200 |
| commit | 6c9c39b6856f8c7540944413bcdc47d02affa237 (patch) | |
| tree | bea277c11ab3dd6760acac970c4cf779a5e8178b /famille.py | |
| parent | 8b0582d44150a5840a03adec8ac87663020564a4 (diff) | |
| download | famille-flask-6c9c39b6856f8c7540944413bcdc47d02affa237.tar.gz | |
Fix edit profile bug: covert to bytestring before computing the hash
Diffstat (limited to 'famille.py')
| -rw-r--r-- | famille.py | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -258,7 +258,7 @@ def edit_user(): result = {} try: if request.form['password'] == request.form['password_confirm']: - result['password'] = hashlib.md5(request.form['password']).\ + result['password'] = hashlib.md5(request.form['password'].encode()).\ hexdigest() else: error = "Les deux mots de passe ne coïncident pas" @@ -287,7 +287,7 @@ def login(): if request.method == 'POST': username = request.form['username'] - password = hashlib.md5(request.form['password'].encode("utf-8")).hexdigest() + password = hashlib.md5(request.form['password'].encode()).hexdigest() user = query_db('select * from users where user_name = ?', (username,), True) if user: |
