mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-22 11:23:10 +00:00
Fix disable_emailnotyetconfirmed task
This commit is contained in:
parent
0c1cf9ac94
commit
0a8ed0bb40
1 changed files with 2 additions and 2 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue