On login hooks get username


i wonder, can i get username from the hooks … i want apply a hook for any user except administrator


Add a condition in your method!

@rmehta can you give an example ?..

Share what have you done so far.

sure here :
def check():
exp_date = frappe.db.get_value(“Global Defaults”,None,“license”)
if exp_date and exp_date!=“”:
expire = datetime.datetime.strptime(exp_date, “%Y-%m-%d”)
if expire <= datetime.datetime.today():
frappe.throw(“License Expire , cant login to your account.”)

but i want to made exception for administrator