Fix add_session prefilling game from last session

When no game_id is provided, the session form should start with no game
selected rather than defaulting to the last session's game.

https://claude.ai/code/session_01BZHdra2YBPwS3umwsGrgUj
This commit is contained in:
Claude
2026-06-07 18:33:54 +00:00
committed by Lukáš Kucharczyk
parent 05e30610e9
commit 061b5e6d8a
-4
View File
@@ -244,10 +244,6 @@ def _session_fields(form) -> SafeText:
def add_session(request: HttpRequest, game_id: int = 0) -> HttpResponse:
initial: dict[str, Any] = {"timestamp_start": timezone.now()}
last = Session.objects.last()
if last is not None:
initial["game"] = last.game
if request.method == "POST":
form = SessionForm(request.POST or None, initial=initial)
if form.is_valid():