Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Task without due date gives error #119

Closed
isabellaalstrom opened this issue Aug 16, 2020 · 0 comments · Fixed by #120
Closed

Task without due date gives error #119

isabellaalstrom opened this issue Aug 16, 2020 · 0 comments · Fixed by #120
Projects

Comments

@isabellaalstrom
Copy link
Contributor

Add a check for due date before parsing

Traceback (most recent call last):
  File "/config/custom_components/grocy/__init__.py", line 268, in async_update_tasks
    ] = await self.hass.async_add_executor_job(self.client.tasks)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.8/site-packages/pygrocy/grocy.py", line 591, in tasks
    raw_tasks = self._api_client.get_tasks()
  File "/usr/local/lib/python3.8/site-packages/pygrocy/grocy_api_client.py", line 649, in get_tasks
    return [TaskResponse(data) for data in parsed_json]
  File "/usr/local/lib/python3.8/site-packages/pygrocy/grocy_api_client.py", line 649, in <listcomp>
    return [TaskResponse(data) for data in parsed_json]
  File "/usr/local/lib/python3.8/site-packages/pygrocy/grocy_api_client.py", line 458, in __init__
    self.due_date = parse_date(parsed_json.get("due_date"))
  File "/usr/local/lib/python3.8/site-packages/pygrocy/utils.py", line 10, in parse_date
    return iso8601.parse_date(input_value)
  File "/usr/local/lib/python3.8/site-packages/iso8601/iso8601.py", line 195, in parse_date
    raise ParseError("Unable to parse date string %r" % datestring)
iso8601.iso8601.ParseError: Unable to parse date string ''
@SebRut SebRut added this to To do in Kanban Aug 17, 2020
Kanban automation moved this from To do to Done Aug 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Kanban
  
Done
Development

Successfully merging a pull request may close this issue.

1 participant