From aa8ef4cc1474d374bd97048dd98ce1aec82dc59a Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Tue, 19 Mar 2013 14:35:19 +0530 Subject: [PATCH] fix to login --- core/doctype/print_format/print_format.py | 1 + webnotes/handler.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/doctype/print_format/print_format.py b/core/doctype/print_format/print_format.py index 0b275fda42..090566dc01 100644 --- a/core/doctype/print_format/print_format.py +++ b/core/doctype/print_format/print_format.py @@ -88,6 +88,7 @@ def get_html(doc, doclist): return html def make_doctype_structure(doctype): + """wip""" s = [] fields = doctype.get({"doctype":"DocField"}) diff --git a/webnotes/handler.py b/webnotes/handler.py index d3d05b3f09..9f1e2831a7 100755 --- a/webnotes/handler.py +++ b/webnotes/handler.py @@ -134,13 +134,13 @@ def uploadfile(): json.dumps(ret)) @webnotes.whitelist(allow_guest=True) -def reset_password(): +def reset_password(user): from webnotes.model.code import get_obj from webnotes.utils import random_string user = webnotes.form_dict.get('user', '') if user in ["demo@erpnext.com", "Administrator"]: - webnotes.msgprint("Not allowed", raise_exception=1) + return "Not allowed" if webnotes.conn.sql("""select name from tabProfile where name=%s""", user): new_password = random_string(8) @@ -151,9 +151,9 @@ def reset_password(): webnotes.session["user"] = "Administrator" profile = get_obj("Profile", user) profile.password_reset_mail(new_password) - webnotes.msgprint("Password has been reset and sent to your email id.") + return "Password has been reset and sent to your email id." else: - webnotes.msgprint("No such user (%s)" % user) + return "No such user (%s)" % user def handle():