aboutsummaryrefslogtreecommitdiff
path: root/management/commands/cleancourses.py
diff options
context:
space:
mode:
authorAlban Gruin2017-11-27 17:18:41 +0100
committerAlban Gruin2017-11-27 17:18:41 +0100
commita5b0d082a728b06e5e02f4d64632ac0b0a572aec (patch)
tree7ad6449000f57b2baa021ad1e8c7f1898c2e55fe /management/commands/cleancourses.py
parent90414449f9f74b675d3793c2c48a796f9bfe4b29 (diff)
Adaptation des commandes cleancourses et listtimetables au changements
Diffstat (limited to 'management/commands/cleancourses.py')
-rw-r--r--management/commands/cleancourses.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/management/commands/cleancourses.py b/management/commands/cleancourses.py
index f6041ef..310c843 100644
--- a/management/commands/cleancourses.py
+++ b/management/commands/cleancourses.py
@@ -22,15 +22,15 @@ class Command(BaseCommand):
help = "Remove all courses and groups from the database"
def add_arguments(self, parser):
- parser.add_argument("--timetable", type=int, nargs="+")
+ parser.add_argument("--source", type=int, nargs="+")
def handle(self, *args, **options):
with transaction.atomic():
- if options["timetable"] is None:
+ if options["source"] is None:
Course.objects.all().delete()
Group.objects.all().delete()
else:
- Course.objects.filter(timetable__id__in=options["timetable"]).delete()
- Group.objects.filter(timetable__id__in=options["timetable"]).delete()
+ Course.objects.filter(source__id__in=options["source"]).delete()
+ Group.objects.filter(source__id__in=options["source"]).delete()
self.stdout.write(self.style.SUCCESS("Done."))