<s> from django . core . management . base import BaseCommand , CommandError <EOL> from django . contrib . auth . models import User , Group <EOL> class Command ( BaseCommand ) : <EOL> args = '<STR_LIT>' <EOL> help = '<STR_LIT>' <EOL> def handle ( self , * args , ** options ) : <EOL> for email in args : <EOL> try : <EOL> user = User . objects . get ( email = email ) <EOL> user . is_staff = True <EOL> user . is_superuser = True <EOL> user . save ( ) <EOL> except User . DoesNotExist : <EOL> raise CommandError ( '<STR_LIT>' ) <EOL> self . stdout . write ( "<STR_LIT>" % ( user . email ) ) </s>
