Skip to content
Extraits de code Groupes Projets
Valider 1ea7c6ba rédigé par luxcem's avatar luxcem
Parcourir les fichiers

Moves fix mandates active commands to memopol

parent f2c45ef9
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
import datetime
from django.core.management.base import BaseCommand
from representatives.models import Mandate
from django.db import transaction
class Command(BaseCommand):
@transaction.atomic
def handle(self, *args, **options):
date = datetime.datetime.now().date()
for mandate in Mandate.objects.all():
mandate.active = mandate.end_date > date
mandate.save()
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter