Don't Error 500 when using other member's Order PK etc

This commit is contained in:
Benjamin Bach 2024-08-04 12:06:52 +02:00
parent 1070e93885
commit a93a879f50
No known key found for this signature in database
GPG key ID: 486F0D69C845416E

View file

@ -102,7 +102,7 @@ def success(request: HttpRequest, order_id: int) -> HttpResponse:
quickly as possible.
"""
user = request.user # People just need to login to pay something, not necessarily be a member
order = models.Order.objects.get(pk=order_id, member=user)
order = get_object_or_404(models.Order, pk=order_id, member=user)
context = {
"order": order,