Skip to content

reject_leave_application: TypeError: 'NoneType' object is not iterable #131

Description

@Denhai
xero_tenant_id = '7f8441b3-9d6c-499b-b28d-1250928c7b65'
leave_application_id = 'd306a1fe-301e-4126-beef-8d72fdf8105a'
payroll_au_api.reject_leave_application(xero_tenant_id, leave_application_id)
File .../.direnv/python-3.11/lib/python3.11/site-packages/xero_python/api_client/deserializer.py:78, in deserialize_list(data_type, data, model_finder)
     76     raise ValueError("Can't deserialize data_type={!r}".format(data_type))
     77 else:
---> 78     return [deserialize(sub_data_type, sub_data, model_finder) for sub_data in data]

TypeError: 'NoneType' object is not iterable

If I turn off deserialization with _preload_content=False, you can see where the None is coming from:

response = payroll_au_api.reject_leave_application(
    xero_tenant_id,
    leave_application_id,
    _preload_content=False
)
response.json()

{'Id': '0945c9d4-3333-4cab-976f-0e877e9ba22b',
 'Status': 'OK',
 'ProviderName': 'Attendance DEV Hayden',
 'DateTimeUTC': '/Date(1716438447128)/',
 'LeaveApplications': None}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions