agritheory / approvals

Customizable Approval Workflows
Other
4 stars 1 forks source link

fix: handle case where fallback approver is not set #25

Closed Alchez closed 2 months ago

Alchez commented 2 months ago
Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 97, in application
    response = frappe.api.handle()
               ^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/api.py", line 55, in handle
    return frappe.handler.handle()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/handler.py", line 48, in handle
    data = execute_cmd(cmd)
           ^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/handler.py", line 86, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/__init__.py", line 1619, in call
    return fn(*args, **newargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "apps/approvals/approvals/approvals/api.py", line 73, in fetch_approvals_and_roles
    if "@" in role and assigned_user == "Unassigned":
       ^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable