Hello, community,
I have strange issue appear in version 12
I have to make tst.html file in template/page folder and add below script to use frappe and use frappe.call to get data from a python function
so I add this script in the head tag
<script>
window.frappe = {};
frappe.ready_events = [];
frappe.ready = function(fn) {
frappe.ready_events.push(fn);
}
window.dev_server = {{ dev_server }};
window.socketio_port = {{ frappe.socketio_port }};
</script>
and include js
<script type="text/javascript"
src="/assets/frappe/js/lib/jquery/jquery.min.js"></script>
<script src="/assets/frappe/js/lib/socket.io.min.js"></script>
<script type="text/javascript" src="/assets/js/frappe-web.min.js"></script>
<script type="text/javascript"
src="/assets/frappe/js/lib/bootstrap.min.js"></script>
This is my js code/
frappe.ready(function () {
frappe.call({
method: 'dashboard.templates.pages.tst1.get_project_list',
callback: function(r) {
if(r){
$("#result").html(r.message)
console.log(r.message)
}
}
});
});
and this is py file/
@frappe.whitelist(allow_guest=True)
def get_project_list():
projects = frappe.db.sql_list("select name from `tabProject` order by modified desc")
return projects
Now when I call this page it successfully gets data(without login to system_as guest)
But if I log in using email and password and call the page again it won’t work and show confirm message and then the system is stop
After refreshing page/
This error appears just after updating to the new version!
Any suggestions?
Thanks