87175215015589c074036ae1c7d56f8a0c3ea529
1 from django
.core
.management
.base
import BaseCommand
, CommandError
2 from sf_user
.models
import CustomSession
5 class Command(BaseCommand
):
6 help = 'Clean Users Sessions'
8 #def add_arguments(self, parser):
9 # parser.add_argument('poll_id', nargs='+', type=int)
11 def handle(self
, *args
, **options
):
13 CustomSession
.objects
.all().delete()
15 raise CommandError('Error unable to clean users sessions')
17 self
.stdout
.write(self
.style
.SUCCESS('Successfully cleaned users sessions'))