Browse Source

Reset clean_notyetactive command to its correct state

release-2.9
Jean-Romain Garnier 6 years ago
committed by Gabriel Detraz
parent
commit
8b4e203783
  1. 4
      users/management/commands/clean_notyetactive.py

4
users/management/commands/clean_notyetactive.py

@ -28,13 +28,13 @@ from django.utils import timezone
class Command(BaseCommand):
help = "Delete non members users (not yet active or disabled too long ago without an invoice)."
help = "Delete non members users (not yet active)."
def handle(self, *args, **options):
"""First deleting invalid invoices, and then deleting the users"""
days = OptionalUser.get_cached_value("disable_emailnotyetconfirmed")
users_to_delete = (
User.objects.filter(Q(state=User.STATE_NOT_YET_ACTIVE) | Q(state=User.STATE_DISABLED))
User.objects.filter(Q(state=User.STATE_NOT_YET_ACTIVE))
.filter(registered__lte=timezone.now() - timedelta(days=days))
.exclude(facture__valid=True)
.distinct()

Loading…
Cancel
Save