limit open payments per user

master
alice 4 years ago
parent ec5e8d4230
commit c30a44f117

@ -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():

Loading…
Cancel
Save