aboutsummaryrefslogtreecommitdiff
path: root/management/commands/timetables.py
diff options
context:
space:
mode:
authorAlban Gruin2017-01-19 21:54:04 +0100
committerAlban Gruin2017-01-19 21:54:04 +0100
commitf55e7ff672ba18291d7361c4c8649e174c9fa556 (patch)
tree887ce3081f0b797dc1de088af3e866652e402d18 /management/commands/timetables.py
parentd70781860ba63d457b63a977a2d403ad9aa160b9 (diff)
Amélioration de la qualité du code de la commande "timetables"
Diffstat (limited to 'management/commands/timetables.py')
-rw-r--r--management/commands/timetables.py10
1 files changed, 1 insertions, 9 deletions
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: