diff options
author | Ernesto Rico-Schmidt <ernesto.rico-schmidt@evolaris.net> | 2016-08-03 19:17:26 (GMT) |
---|---|---|
committer | Ernesto Rico-Schmidt <ernesto.rico-schmidt@evolaris.net> | 2016-08-03 19:18:51 (GMT) |
commit | 1ee756130945cf5e60955945d01a6bb018620cac (patch) | |
tree | 184d77959bf2c5c0860983a8ed51bbb813b9d647 /program/management/commands/remove_automation_id.py | |
parent | 4cfbc102d21302d774b558230f10252b40170944 (diff) |
added management commands to chech and remove stale automation_ids
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) |