From f55e7ff672ba18291d7361c4c8649e174c9fa556 Mon Sep 17 00:00:00 2001 From: Alban Gruin Date: Thu, 19 Jan 2017 21:54:04 +0100 Subject: Amélioration de la qualité du code de la commande "timetables" --- management/commands/timetables.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'management/commands/timetables.py') diff --git a/management/commands/timetables.py b/management/commands/timetables.py index 81e5a7d..99742ae 100644 --- a/management/commands/timetables.py +++ b/management/commands/timetables.py @@ -39,15 +39,7 @@ class Command(BaseCommand): weeks = get_weeks(soup) for name, type_, groups, rooms, notes, begin, end in get_events(soup, weeks, week, timetable): - course = Course.objects.create(timetable=timetable, begin=begin, end=end) - - if name is not None: - course.name = name - course.notes = notes - elif notes is not None: - course.name = notes - else: - course.name = "Aucune information" + course = Course.objects.create(name=name, notes=notes, timetable=timetable, begin=begin, end=end) course.groups.add(*groups) if rooms is not None: -- cgit v1.2.1