mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-08 10:56:27 +00:00
Reset clean_notyetactive command to its correct state
This commit is contained in:
parent
6d0c53d667
commit
8b4e203783
1 changed files with 2 additions and 2 deletions
|
@ -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…
Reference in a new issue