diff --git a/billing/views.py b/billing/views.py index fa87276..1c2de6f 100644 --- a/billing/views.py +++ b/billing/views.py @@ -68,7 +68,7 @@ def generate_invoice(request, instance_name: str): delta = now - timedelta(seconds=(60 * 60 * 24 * 30)) # one month payment = None - for p in Payment.objects.filter(date__gt=(delta)): + for p in Payment.objects.filter(date__gt=(delta), instance_name=instance_name): if p.status == PaymentStatus.CONFIRMED: return HttpResponse("BAD REQUEST: Already paid", status=400) elif any([p.status == PaymentStatus.INPUT, p.status == PaymentStatus.WAITING]):