diff options
Diffstat (limited to 'program/management/commands/remove_automation_id.py')
-rw-r--r-- | program/management/commands/remove_automation_id.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/program/management/commands/remove_automation_id.py b/program/management/commands/remove_automation_id.py new file mode 100644 index 0000000..4fb8ee7 --- /dev/null +++ b/program/management/commands/remove_automation_id.py @@ -0,0 +1,16 @@ +from django.core.management.base import BaseCommand, CommandError + +from program.models import ProgramSlot + + +class Command(BaseCommand): + help = 'removes the automation_id from the program slots' + args = '<automation_id>' + + def handle(self, *args, **options): + if len(args) == 1: + automation_id = args[0] + else: + raise CommandError('you must provide the automation_id') + + ProgramSlot.objects.filter(automation_id=automation_id).update(automation_id=None) |