[password-resets] Revert "Let it fail"
- From: Andrea Veri <averi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [password-resets] Revert "Let it fail"
- Date: Mon, 23 Nov 2020 12:34:31 +0000 (UTC)
commit 6ba77070e492c3b20ed3fe39b3f8eb9ef7e821e0
Author: Andrea Veri <averi redhat com>
Date: Mon Nov 23 13:33:13 2020 +0100
Revert "Let it fail"
This reverts commit a77152527aa9cab1762cb7fc25c42aced7cd3ed3.
app.py | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/app.py b/app.py
index 16cb0d4..e0411f1 100644
--- a/app.py
+++ b/app.py
@@ -96,18 +96,18 @@ def form_reset_post(request: Request, token: str, password: str = Form(...)):
t = Session.query(Token).filter(Token.token==token).first()
if t:
-# try:
- glu.replace_ldap_password(t.username, newpassword)
+ try:
+ glu.replace_ldap_password(t.username, newpassword)
- t.claimed = 1
- Session.commit()
- Session.remove()
+ t.claimed = 1
+ Session.commit()
+ Session.remove()
- # return templates.TemplateResponse('general-form.html', context={'request': request,
'passwordsuccess': True})
-# except:
-# Session.remove()
+ return templates.TemplateResponse('general-form.html', context={'request': request,
'passwordsuccess': True})
+ except:
+ Session.remove()
-# return templates.TemplateResponse('general-form.html', context={'request': request,
'passworderror': True})
+ return templates.TemplateResponse('general-form.html', context={'request': request,
'passworderror': True})
def send_email(email, token):
import imghdr
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]