Created
February 14, 2015 17:38
-
-
Save drager/3fd7e612dbded567a92e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.contrib.auth.models import User | |
| from django.core.management.base import NoArgsCommand | |
| from django.utils.timezone import now | |
| class Command(NoArgsCommand): | |
| help = "Delete inactive users that has a expired activation key." | |
| def handle(self, **options): | |
| User.objects.filter(is_active=False, userprofile__key_expires__lte=now()).delete() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment