14 lines
303 B
Python
14 lines
303 B
Python
import logging
|
|
from django.utils import timezone
|
|
|
|
from .models import Participant
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
def purge_participants():
|
|
now = timezone.now()
|
|
for p in Participant.objects.filter(purge_at__lte=now):
|
|
logger.info('Purge participant \'%s\'', p)
|
|
p.delete()
|