瀏覽代碼

handler.py: don't update demo password

version-14
Rushabh Mehta 12 年之前
父節點
當前提交
1a7a6b228f
共有 1 個檔案被更改,包括 3 行新增0 行删除
  1. +3
    -0
      webnotes/handler.py

+ 3
- 0
webnotes/handler.py 查看文件

@@ -138,6 +138,9 @@ def reset_password():
from webnotes.utils import random_string from webnotes.utils import random_string
user = webnotes.form_dict.get('user', '') user = webnotes.form_dict.get('user', '')
if user in ["demo@erpnext.com", "Administrator"]:
webnotes.msgprint("Not allowed", raise_exception=1)
if webnotes.conn.sql("""select name from tabProfile where name=%s""", user): if webnotes.conn.sql("""select name from tabProfile where name=%s""", user):
new_password = random_string(8) new_password = random_string(8)
webnotes.conn.sql("""update `__Auth` set password=password(%s) webnotes.conn.sql("""update `__Auth` set password=password(%s)


Loading…
取消
儲存