ADD: dav_events: purging participants.
This commit is contained in:
13
dav_events/utils.py
Normal file
13
dav_events/utils.py
Normal file
@@ -0,0 +1,13 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user