Commit 78a2c52d authored by jtchilders's avatar jtchilders
Browse files

renamed balsam_rm_job

parent 550b75ee
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from balsam import models
import logging
logger = logging.getLogger('console')
class Command(BaseCommand):
help = 'Remove BalsamJobs'
def add_arguments(self, parser):
# Positional arguments
parser.add_argument('--pk', nargs='+', type=int,help='remove the specified jobs.',required=True)
def handle(self, *args, **options):
if options['pk'] is not None:
jobs = models.BalsamJob.objects.filter(pk__in=options['pk'])
for job in jobs:
logger.info('About to delete BalsamJob pk = ' + str(job.pk) + ' \n' + str(job))
answer = raw_input(' Enter "yes" to continue: ')
if answer == 'yes':
job.delete()
logger.info('BalsamJob deleted')
else:
logger.info('BalsamJob not deleted')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment