first commit
This commit is contained in:
0
accounts/management/commands/__init__.py
Normal file
0
accounts/management/commands/__init__.py
Normal file
12
accounts/management/commands/deactivate_expired_users.py
Normal file
12
accounts/management/commands/deactivate_expired_users.py
Normal file
@@ -0,0 +1,12 @@
|
||||
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).'))
|
||||
Reference in New Issue
Block a user