blob: 87175215015589c074036ae1c7d56f8a0c3ea529 [file] [log] [blame]
lombardoffb37bca2018-05-03 16:20:04 +02001from django.core.management.base import BaseCommand, CommandError
2from sf_user.models import CustomSession
3
4
5class Command(BaseCommand):
6 help = 'Clean Users Sessions'
7
8 #def add_arguments(self, parser):
9 # parser.add_argument('poll_id', nargs='+', type=int)
10
11 def handle(self, *args, **options):
12 try:
13 CustomSession.objects.all().delete()
14 except Exception:
15 raise CommandError('Error unable to clean users sessions')
16
17 self.stdout.write(self.style.SUCCESS('Successfully cleaned users sessions'))