Don't automatically deactivate anyone that's never logged in

That's bloody stupid
This commit is contained in:
2023-10-21 16:28:29 +01:00
parent e265ad58a6
commit 240ff25c63

View File

@@ -12,8 +12,8 @@ class Command(BaseCommand):
def handle(self, *args, **options): def handle(self, *args, **options):
for person in Profile.objects.all(): for person in Profile.objects.all():
# Inactivate users that have not logged in for a year (or have never logged in) # Inactivate users that have not logged in for a year
if person.last_login is None or (timezone.now() - person.last_login).days > 365: if person.last_login is not None and (timezone.now() - person.last_login).days > 365:
person.is_active = False person.is_active = False
person.is_approved = False person.is_approved = False
person.save() person.save()