XeroAPI / xero-python

Official Xero OAuth 2.0 python SDK
MIT License
132 stars 52 forks source link

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

Open Denhai opened 5 months ago

Denhai commented 5 months ago
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}
github-actions[bot] commented 5 months ago

PETOSS-424

github-actions[bot] commented 5 months ago

Thanks for raising an issue, a ticket has been created to track your request