[password-resets] Let it fail



commit a77152527aa9cab1762cb7fc25c42aced7cd3ed3
Author: Andrea Veri <averi redhat com>
Date:   Mon Nov 23 13:24:00 2020 +0100

    Let it fail

 app.py | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/app.py b/app.py
index e0411f1..16cb0d4 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]