Fix possible server error

This commit is contained in:
Lukáš Kucharczyk 2025-01-30 11:56:47 +01:00
parent 4ec1cf5f28
commit 69d27958f3
Signed by: lukas
SSH Key Fingerprint: SHA256:vMuSwvwAvcT6htVAioMP7rzzwMQNi3roESyhv+nAxeg
1 changed files with 1 additions and 1 deletions

View File

@ -165,7 +165,7 @@ def view_game(request: HttpRequest, game_id: int) -> HttpResponse:
session_count = sessions.count() session_count = sessions.count()
session_count_without_manual = game.sessions.without_manual().count() session_count_without_manual = game.sessions.without_manual().count()
if sessions: if sessions.exists():
playrange_start = local_strftime(sessions.earliest().timestamp_start, "%b %Y") playrange_start = local_strftime(sessions.earliest().timestamp_start, "%b %Y")
latest_session = sessions.latest() latest_session = sessions.latest()
playrange_end = local_strftime(latest_session.timestamp_start, "%b %Y") playrange_end = local_strftime(latest_session.timestamp_start, "%b %Y")