def POST_resend_verification_email(self, i): try: ol_login = OpenLibraryAccount.authenticate(i.email, i.password) except ClientException, e: code = e.get_data().get("code") if code != "account_not_verified": return self.error("account_incorrect_password", i)
def POST_resend_verification_email(self, i): try: ol_login = OpenLibraryAccount.authenticate(i.email, i.password) except ClientException as e: code = e.get_data().get("code") if code != "account_not_verified": return self.error("account_incorrect_password", i) account = OpenLibraryAccount.get(email=i.email) account.send_verification_email() title = _("Hi, %(user)s", user=account.displayname) message = _("We've sent the verification email to %(email)s. You'll need to read that and click on the verification link to verify your email.", email=account.email) return render.message(title, message)
def POST(self): i = web.input(username='', password='') err = "" act = OpenLibraryAccount.get(username=i.username) if act: if OpenLibraryAccount.authenticate(act.email, i.password) == "ok": return render_template('account/email/forgot', email=act.email) err = "Incorrect password" elif valid_email(i.username): err = "Please enter a username, not an email" else: err = "Sorry, this user does not exist" return render_template('account/email/forgot', err=err)
def POST(self): i = web.input(username='', password='') err = "" act = OpenLibraryAccount.get(username=i.username) if act: if OpenLibraryAccount.authenticate(act.email, i.password) == "ok": return render_template('account/email/forgot', email=act.email) else: err = "Incorrect password" elif valid_email(i.username): err = "Please enter a username, not an email" else: err="Sorry, this user does not exist" return render_template('account/email/forgot', err=err)
def POST(self): i = web.input(email='', password='') err = "" if valid_email(i.email): act = OpenLibraryAccount.get(email=i.email) if act: if OpenLibraryAccount.authenticate(i.email, i.password) == "ok": ia_act = act.get_linked_ia_account() if ia_act: return render_template('account/email/forgot-ia', email=ia_act.email) else: err = "Open Library Account not linked. Login with your Open Library credentials to connect or create an Archive.org account" else: err = "Incorrect password" else: err = "Sorry, this Open Library account does not exist" else: err = "Please enter a valid Open Library email" return render_template('account/email/forgot-ia', err=err)