Hey,
I am stuck on customizing the login page. Its quite confusing to modify the code in login.py, .html and .js . Is it possible to add js and html to the login page using the website module?
Also, why doesn’t some frappe calls work before the user is logged in ? I tried to add code for prompt in login.js file (frappe.prompt) but the page gets stuck. frappe.msgprint works fine . Can anything be done about this ? i need the prompt before it successfully logs in.
Thanks,
Akarsh
calls like frappe.db and frappe.get_doc are not permitted !!! . I need to access db (store and retrieve) by running a python code in whitelisted function before logining in . Any idea how can i do that ?
@Akarsh_Hegde, @frappe.whitelist(allow_guest=True)
hey @max_morais_dmm , i have used that.I get “Not Permitted” when it executes frappe.db.mysql or frappe.get_doc. Not sure why
@Akarsh_Hegde, do you refreshed the services?
Do u mean reloading (clear-cache) ? yes I have done that!
I was able to insert and retrieve from db somehow. But i face a new problem . I am trying to stop the login process from continuing using a function call based on value from the db.
frappe.throw(_("OTP Does Not Match"), frappe.AuthenticationError)
Although this does throw the Exception, It doesn’t actually stop the process from continuing and the user still gets logged in . Any ideas which call can i make that interrupts the process ?
@Akarsh_Hegde, I mean stopping and starting bench start
or running bench restart
@max_morais_dmm , Yes i have done that as well. I think its working now .
Any idea what i can do for this ?
frappe.throw(_("OTP Does Not Match"), frappe.AuthenticationError)
Although this does throw the Exception, It doesn't actually stop the
process from continuing and the user still gets logged in . Any ideas
which call can i make that stops the login process ?
Edit : Even system calls like sys.exit()
and raise SystemExit
don’t seem to work