Creating session from purchase only works for a single-game purchases #83

Open
opened 2025-01-29 20:16:28 +00:00 by lukas · 0 comments
Owner

After allowing purchases to contain more than 1 game it is no longer possible to automatically decide which game should be used for the "Submit & Create Session".

As a stopgap solution, we use purchase.first_game but this makes it impossible to select anything else. In the future there could be a modal dialogue asking the user which game he wants to start tracking.

In purchase.py:

if "submit_and_redirect" in request.POST:
                return HttpResponseRedirect(
                    reverse(
                        "add_session_for_game",
                        kwargs={"game_id": purchase.first_game.id},
                    )
                )
After allowing purchases to contain more than 1 game it is no longer possible to automatically decide which game should be used for the "Submit & Create Session". As a stopgap solution, we use `purchase.first_game` but this makes it impossible to select anything else. In the future there could be a modal dialogue asking the user which game he wants to start tracking. In `purchase.py`: ```py if "submit_and_redirect" in request.POST: return HttpResponseRedirect( reverse( "add_session_for_game", kwargs={"game_id": purchase.first_game.id}, ) ) ```
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#83
No description provided.