Files
insta/accounts/management/commands/deactivate_expired_users.py
Beyhan Oğur 2be3a313ad first commit
2026-04-26 22:26:46 +03:00

13 lines
396 B
Python

from django.core.management.base import BaseCommand
from accounts.tasks import deactivate_expired_users_task
class Command(BaseCommand):
help = 'Deactivate users whose active period has expired.'
def handle(self, *args, **options):
updated_count = deactivate_expired_users_task()
self.stdout.write(self.style.SUCCESS(f'Deactivated {updated_count} expired user(s).'))