diff --git a/payments/views.py b/payments/views.py index 4a797bb..07aff5f 100644 --- a/payments/views.py +++ b/payments/views.py @@ -27,6 +27,10 @@ def new(request): if request.method != 'POST': return redirect('account:index') + if Payment.objects.filter(user=request.user, status='new').count() > 10: + messages.error(request, "Too many open payments.") + return redirect('account:index') + form = NewPaymentForm(request.POST) if not form.is_valid():