fix: type checking

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
This commit is contained in:
Shariq Ansari 2022-12-20 15:33:03 +05:30 committed by GitHub
parent 8c947f5abf
commit 68baa81f3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -148,7 +148,7 @@ def login_via_token(login_token):
@frappe.whitelist(allow_guest=True)
def send_login_link(email, subject=None):
def send_login_link(email: str, subject: str | None =None):
if not frappe.db.exists("User", email):
frappe.throw("No registered account with this email address")
@ -173,7 +173,7 @@ def send_login_link(email, subject=None):
@frappe.whitelist(allow_guest=True)
def login_via_key(key):
def login_via_key(key: str):
cache_key = f"one_time_login_key:{key}"
email = frappe.cache().get_value(cache_key)