ubernostrum / django-registration

A user-registration application for Django.

    #   Introduced
1
2a7667bb6a64
"""
2
2a7667bb6a64
A management command which deletes expired accounts (e.g.,
3
2a7667bb6a64
accounts which signed up but never activated) from the database.
4
2a7667bb6a64
5
2a7667bb6a64
Calls ``RegistrationProfile.objects.delete_expired_users()``, which
6
2a7667bb6a64
contains the actual logic for determining which accounts are deleted.
7
2a7667bb6a64
8
2a7667bb6a64
"""
9
2a7667bb6a64
10
2a7667bb6a64
from django.core.management.base import NoArgsCommand
11
2a7667bb6a64
12
2a7667bb6a64
from registration.models import RegistrationProfile
13
2a7667bb6a64
14
2a7667bb6a64
15
2a7667bb6a64
class Command(NoArgsCommand):
16
2a7667bb6a64
    help = "Delete expired user registrations from the database"
17
2a7667bb6a64
18
2a7667bb6a64
    def handle_noargs(self, **options):
19
2a7667bb6a64
        RegistrationProfile.objects.delete_expired_users()