neue Verzeichnissstruktur
This commit is contained in:
15
membership/management/commands/cleanup-registration.py
Normal file
15
membership/management/commands/cleanup-registration.py
Normal file
@@ -0,0 +1,15 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from django.contrib.auth.models import User
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from membership.models import ActivationRequest
|
||||
|
||||
class Command(BaseCommand):
|
||||
help = "Delete all expired user registrations from the database"
|
||||
|
||||
def handle(self, *args, **options):
|
||||
|
||||
for activation in ActivationRequest.objects.expired():
|
||||
activation.user.delete()
|
||||
|
||||
Reference in New Issue
Block a user