def handle(self, *args, **options):
        for email in args:
            try:
                user = User.objects.get(email=email)
                user.is_staff = True
                user.is_superuser = True
                user.save()
            except User.DoesNotExist:
                raise CommandError('User does not exist')

            self.stdout.write("Set %s as admin\n" % (user.email))
dataset/ETHPy150Open OpenMOOC/askbot-openmooc/askbotopenmooc/app/management/commands/set_admin.py/Command.handle/original