What are the value of the checkboxes in the module profile.?

If you haven’t checked then check it.

Thank You!

1 Like

Hey thanks for the reply . :handshake:t2:

But i got stuck in the block modules

when i get values for the block modues from the api. it blocks those module[it unchecked those modules] but i want to check those modules particularly, but by default all the module is checked…how can i uncheck other modules and check the specific module from the api.?
[ the passing block module is getting unchecked but i want them to be checked specifically and the other modules to be uncheked ]

@frappe.whitelist( allow_guest = True )
def insert_user(first_name,email):

user = frappe.get_doc({
    "roles": [{"role": "System Manager"},{"role": "Blogger"},{"role": "Loan Manager"}],
    "block_modules":[{"module":"Contacts"},{"module":"Core"},{"module":"Email"},{"module": "Desk"},{"module": "Accounts"}] 


return f"The data for {first_name} inserted"

somehow i find the solution by deleting the modules in the block modules for the respective user to mark the module checked for that user[ in the above relpy i pass all the block module’s module to make all of them unchecked ]

@frappe.whitelist(allow_guest = True)
def allow_mod(email,modules):
    m_filter = modules.split(',')
    for i in range(1):
        for j in m_filter:
            frappe.db.sql(f"""delete from `tabBlock Module` where module = "{j}" and parent = "{em}";""")
    return f"module for {email} is added"