From 0a8ed0bb40c061cd5be53199bc54abdfa4b23027 Mon Sep 17 00:00:00 2001 From: Jean-Romain Garnier Date: Fri, 17 Apr 2020 13:14:32 +0000 Subject: [PATCH] Fix disable_emailnotyetconfirmed task --- users/management/commands/disable_emailnotyetconfirmed.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/users/management/commands/disable_emailnotyetconfirmed.py b/users/management/commands/disable_emailnotyetconfirmed.py index b2678c19..e6de32f3 100644 --- a/users/management/commands/disable_emailnotyetconfirmed.py +++ b/users/management/commands/disable_emailnotyetconfirmed.py @@ -34,11 +34,11 @@ class Command(BaseCommand): days = OptionalUser.get_cached_value("disable_emailnotyetconfirmed") users_to_disable = ( User.objects.filter(state=User.STATE_EMAIL_NOT_YET_CONFIRMED) - .exclude(email_change_date__is_null=True) .filter(email_change_date__lte=timezone.now() - timedelta(days=days)) .distinct() ) print("Disabling " + str(users_to_disable.count()) + " users.") for user in users_to_disable: - self.state = User.STATE_DISABLED + user.state = User.STATE_DISABLED + user.save()