Make it easier to create a play event
This commit is contained in:
parent
b29e4edd72
commit
f7e426e030
@ -115,6 +115,8 @@ def add_playevent(request: HttpRequest, game_id: int = 0) -> HttpResponse:
|
|||||||
# coming from add_playevent_for_game url path
|
# coming from add_playevent_for_game url path
|
||||||
game = get_object_or_404(Game, id=game_id)
|
game = get_object_or_404(Game, id=game_id)
|
||||||
initial["game"] = game
|
initial["game"] = game
|
||||||
|
initial["started"] = game.sessions.earliest().timestamp_start
|
||||||
|
initial["ended"] = game.sessions.latest().timestamp_start
|
||||||
form = PlayEventForm(request.POST or None, initial=initial)
|
form = PlayEventForm(request.POST or None, initial=initial)
|
||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
form.save()
|
form.save()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user