2024-02-23 17:02:24 +00:00
|
|
|
# Copyright (C) 2024 by Animath
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2024-06-07 14:35:08 +00:00
|
|
|
from django.conf import settings
|
2024-02-23 17:02:24 +00:00
|
|
|
from django.core.management import BaseCommand
|
|
|
|
|
2024-02-23 22:05:10 +00:00
|
|
|
from ...models import Payment
|
2024-02-23 17:02:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Command(BaseCommand):
|
|
|
|
"""
|
|
|
|
This command sends a mail to each participant who has not yet paid.
|
|
|
|
"""
|
|
|
|
help = "Envoie un mail de rappel à toustes les participant⋅es qui n'ont pas encore payé ou déclaré de paiement."
|
|
|
|
|
|
|
|
def handle(self, *args, **options):
|
2024-06-07 14:35:08 +00:00
|
|
|
if not settings.PAYMENT_MANAGEMENT:
|
|
|
|
return
|
|
|
|
|
2024-02-23 17:02:24 +00:00
|
|
|
for payment in Payment.objects.filter(valid=False).filter(registrations__team__participation__valid=True).all():
|
|
|
|
payment.send_remind_mail()
|