refactor: convert doctype user db.sql calls
This commit is contained in:
parent
4cae147aed
commit
2efed9d12e
1 changed files with 2 additions and 4 deletions
|
|
@ -698,13 +698,11 @@ def has_email_account(email):
|
|||
|
||||
@frappe.whitelist(allow_guest=False)
|
||||
def get_email_awaiting(user):
|
||||
waiting = frappe.db.sql("""select email_account,email_id
|
||||
from `tabUser Email`
|
||||
where awaiting_password = 1
|
||||
and parent = %(user)s""", {"user":user}, as_dict=1)
|
||||
waiting = frappe.get_all("User Email", fields=["email_account", "email_id"], filters={"awaiting_password": 1, "parent": user})
|
||||
if waiting:
|
||||
return waiting
|
||||
else:
|
||||
# TODO
|
||||
frappe.db.sql("""update `tabUser Email`
|
||||
set awaiting_password =0
|
||||
where parent = %(user)s""",{"user":user})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue