16 lines
478 B
Python
16 lines
478 B
Python
# -*- 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()
|
|
|