def get_context(context):
# do your magic here
pass
this is the content of python file
both the files are in same directory ie., /frappe-bench/apps/healthcare/healthcare/loyalty/web_form/registration_loyalty_program
when i opened the web form it is showing the below error
Failed to get method for command healthcare.loyalty.create_user_and_assign_role with module ‘healthcare.loyalty’ has no attribute ‘create_user_and_assign_role’
i changed the path according to @Viral_Kansodiya reply
frappe.ready(function(){
console.log(‘in ready’);
frappe.call({
method: ‘healthcare.loyalty.web_form.registration_loyalty_program.registration_loyalty_program.create_user_and_assign_role’,
args: {
data: {
email: $(‘#email’).val(),
// first_name: $(‘#first_name’).val(),
// last_name: $(‘#last_name’).val()
}
},
callback: function(response) {
// Handle the response
console.log(‘response:’, response);
}
});
})
but still i am getting this error
Failed to get method for command healthcare.loyalty.web_form.registration_loyalty_program.registration_loyalty_program.create_user_and_assign_role with module ‘healthcare.loyalty.web_form.registration_loyalty_program.registration_loyalty_program’ has no attribute ‘create_user_and_assign_role’
.py file contains the create_user_and_assign_role() function
import frappe
@frappe.whitelist()
def validate_user(username, password):
return f’{username} {password} in validate_user()’
def get_context(context):
pass
both js and py files are in same directory ie.,
~/frappe-bench/apps/healthcare/healthcare/loyalty/web_form/registration_loyalty_program
still why i am getting this error