Skip to content

Commit

Permalink
Don't automatically deactivate anyone that's never logged in
Browse files Browse the repository at this point in the history
That's bloody stupid
  • Loading branch information
FreneticScribbler committed Oct 21, 2023
1 parent e265ad5 commit 240ff25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions users/management/commands/usercleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 240ff25

Please sign in to comment.