Error when filtering for a game/edition/purchase where all sessions are manual #51

Closed
opened 2023-09-18 17:33:17 +00:00 by lukas · 0 comments
Owner

Reproduction:

  1. Add 2 sessions where each is manual (ie. no timestamp_end)
  2. Filter for only those 2 sessions
  3. See error
"GET /tracker/list-sessions/ HTTP/1.1" 200 539563
Internal Server Error: /tracker/list-sessions/by-game/52
Traceback (most recent call last):
  File "C:\Users\lukas\AppData\Local\pypoetry\Cache\virtualenvs\timetracker-_PV8ETog-py3.10\lib\site-packages\django\core\handlers\exception.py", line 55, in inner
    response = get_response(request)
  File "C:\Users\lukas\AppData\Local\pypoetry\Cache\virtualenvs\timetracker-_PV8ETog-py3.10\lib\site-packages\django\core\handlers\base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "C:\Users\lukas\Documents\git\timetracker\games\views.py", line 189, in list_sessions
    context["chart"] = playtime_over_time_chart(dataset.order_by("timestamp_start"))
  File "C:\Users\lukas\Documents\git\timetracker\common\plots.py", line 41, in playtime_over_time_chart
    return get_chart(
  File "C:\Users\lukas\Documents\git\timetracker\common\plots.py", line 68, in get_chart
    first = x[0]
IndexError: list index out of range
Reproduction: 1. Add 2 sessions where each is manual (ie. no timestamp_end) 2. Filter for only those 2 sessions 3. See error ``` "GET /tracker/list-sessions/ HTTP/1.1" 200 539563 Internal Server Error: /tracker/list-sessions/by-game/52 Traceback (most recent call last): File "C:\Users\lukas\AppData\Local\pypoetry\Cache\virtualenvs\timetracker-_PV8ETog-py3.10\lib\site-packages\django\core\handlers\exception.py", line 55, in inner response = get_response(request) File "C:\Users\lukas\AppData\Local\pypoetry\Cache\virtualenvs\timetracker-_PV8ETog-py3.10\lib\site-packages\django\core\handlers\base.py", line 197, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "C:\Users\lukas\Documents\git\timetracker\games\views.py", line 189, in list_sessions context["chart"] = playtime_over_time_chart(dataset.order_by("timestamp_start")) File "C:\Users\lukas\Documents\git\timetracker\common\plots.py", line 41, in playtime_over_time_chart return get_chart( File "C:\Users\lukas\Documents\git\timetracker\common\plots.py", line 68, in get_chart first = x[0] IndexError: list index out of range ```
lukas closed this issue 2023-09-18 17:38:31 +00:00
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: lukas/timetracker#51
No description provided.