From 240ff25c6360350e92f245861d8829855614f370 Mon Sep 17 00:00:00 2001 From: FreneticScribbler Date: Sat, 21 Oct 2023 16:28:29 +0100 Subject: [PATCH] Don't automatically deactivate anyone that's never logged in That's bloody stupid --- users/management/commands/usercleanup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/users/management/commands/usercleanup.py b/users/management/commands/usercleanup.py index 5b538ce8..b70877e9 100644 --- a/users/management/commands/usercleanup.py +++ b/users/management/commands/usercleanup.py @@ -12,8 +12,8 @@ class Command(BaseCommand): def handle(self, *args, **options): for person in Profile.objects.all(): - # Inactivate users that have not logged in for a year (or have never logged in) - if person.last_login is None or (timezone.now() - person.last_login).days > 365: + # Inactivate users that have not logged in for a year + if person.last_login is not None and (timezone.now() - person.last_login).days > 365: person.is_active = False person.is_approved = False person.save()