fix non-working views

This commit is contained in:
Lukáš Kucharczyk 2024-08-09 13:12:47 +02:00
parent c15eaca205
commit e79cf5de7a
Signed by: lukas
SSH Key Fingerprint: SHA256:vMuSwvwAvcT6htVAioMP7rzzwMQNi3roESyhv+nAxeg
1 changed files with 3 additions and 3 deletions

View File

@ -48,7 +48,7 @@ def stats_dropdown_year_range(request: HttpRequest) -> dict[str, range]:
@login_required @login_required
def add_session(request: HttpRequest, purchase_id: int) -> HttpResponse: def add_session(request: HttpRequest, purchase_id: int = 0) -> HttpResponse:
context = {} context = {}
initial: dict[str, Any] = {"timestamp_start": timezone.now()} initial: dict[str, Any] = {"timestamp_start": timezone.now()}
@ -831,7 +831,7 @@ def delete_purchase(request: HttpRequest, purchase_id: int) -> HttpResponse:
@login_required @login_required
def add_purchase(request: HttpRequest, edition_id: int) -> HttpResponse: def add_purchase(request: HttpRequest, edition_id: int = 0) -> HttpResponse:
context: dict[str, Any] = {} context: dict[str, Any] = {}
initial = {"date_purchased": timezone.now()} initial = {"date_purchased": timezone.now()}
@ -886,7 +886,7 @@ def add_game(request: HttpRequest) -> HttpResponse:
@login_required @login_required
def add_edition(request: HttpRequest, game_id: int) -> HttpResponse: def add_edition(request: HttpRequest, game_id: int = 0) -> HttpResponse:
context: dict[str, Any] = {} context: dict[str, Any] = {}
if request.method == "POST": if request.method == "POST":
form = EditionForm(request.POST or None) form = EditionForm(request.POST or None)