summaryrefslogtreecommitdiff
path: root/scripts/bp_deactivate.py
blob: 1a125d52132a9cfc4bfeeca6fe13783d7268094a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from django.utils import timezone

from web.models import Event


def deactivate():
    today = timezone.now()

    active_events = Event.objects.filter(active=True).all()
    for event in active_events:
        if 'BP' in event.name:
            if event.end_date < today:
                event.active = False
                event.save()