]> git.parisson.com Git - teleforma.git/commitdiff
bugfix
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Sun, 14 Nov 2021 17:55:19 +0000 (18:55 +0100)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Sun, 14 Nov 2021 17:55:19 +0000 (18:55 +0100)
teleforma/management/commands/teleforma-import-conferences-create-2.py

index 86a2e1140b6e8402c85cdeca9fc68bad61499fb9..dc50bf05229616663237bdf906ad6bd694b125ed 100644 (file)
@@ -64,10 +64,12 @@ class Command(BaseCommand):
                     path = dir + os.sep + filename
                     collection_id = '_'.join([department_name, course_id, course_type])
 
+                    courses = Course.objects.filter(code=course_id)
                     conferences = Conference.objects.filter(public_id=public_id)
                     if conferences:
                         conference = conferences[0]
                     else:
+                        course = courses[0]
                         conference = Conference(public_id=public_id)
                         conference.course = course_obj
                         conference.course_type = course_type_obj