redirect to purchase list after modifying purchase

This commit is contained in:
Lukáš Kucharczyk 2024-09-10 14:50:49 +02:00
parent 3063a3d143
commit 1c73268258
Signed by: lukas
SSH Key Fingerprint: SHA256:vMuSwvwAvcT6htVAioMP7rzzwMQNi3roESyhv+nAxeg
1 changed files with 3 additions and 3 deletions

View File

@ -204,7 +204,7 @@ def edit_purchase(request: HttpRequest, purchase_id: int) -> HttpResponse:
def delete_purchase(request: HttpRequest, purchase_id: int) -> HttpResponse: def delete_purchase(request: HttpRequest, purchase_id: int) -> HttpResponse:
purchase = get_object_or_404(Purchase, id=purchase_id) purchase = get_object_or_404(Purchase, id=purchase_id)
purchase.delete() purchase.delete()
return redirect("list_sessions") return redirect("list_purchases")
@login_required @login_required
@ -212,7 +212,7 @@ def drop_purchase(request: HttpRequest, purchase_id: int) -> HttpResponse:
purchase = get_object_or_404(Purchase, id=purchase_id) purchase = get_object_or_404(Purchase, id=purchase_id)
purchase.date_dropped = timezone.now() purchase.date_dropped = timezone.now()
purchase.save() purchase.save()
return redirect("list_sessions") return redirect("list_purchases")
@login_required @login_required
@ -220,7 +220,7 @@ def refund_purchase(request: HttpRequest, purchase_id: int) -> HttpResponse:
purchase = get_object_or_404(Purchase, id=purchase_id) purchase = get_object_or_404(Purchase, id=purchase_id)
purchase.date_refunded = timezone.now() purchase.date_refunded = timezone.now()
purchase.save() purchase.save()
return redirect("list_sessions") return redirect("list_purchases")
def related_purchase_by_edition(request: HttpRequest) -> HttpResponse: def related_purchase_by_edition(request: HttpRequest) -> HttpResponse: