Web Form bug or not?

When I create a new webform I want to map with some data.

I followed the code here from this tutorial:


min 9:22

And this is my code:

def get_context(context):
    # do your magic here
    comp = frappe.get_value(doctype="Customer",
                            filters={"name": frappe.session.user},

    frappe.form_dict.name = comp
    frappe.form_dict.new = 0
    context.doc = frappe.get_doc("Customer", comp)

When I enter Hardcoded name on Filters it returns success, but when I enter frappe.session.user it return this error:
Page missing or removed

BUT, when I try on WWW folder frappe.session.user , it works perfectly.

Any idea why it is giving me this error?

1 Like