]> git.parisson.com Git - teleforma.git/commitdiff
update conf import
authorGuillaume Pellerin <yomguy@parisson.com>
Wed, 29 Jan 2014 16:26:31 +0000 (17:26 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Wed, 29 Jan 2014 16:26:31 +0000 (17:26 +0100)
teleforma/management/commands/teleforma-import-conferences.py

index efeeb219a23d45c3be11d2e3822c3452f7747a13..829b18ddc79026376a52450e273e9d25e3c5d20d 100644 (file)
@@ -52,11 +52,14 @@ class Command(BaseCommand):
 
     def handle(self, *args, **options):
         organization_name = args[0]
-        log_file = args[1]
+        department_name = args[1]
+        log_file = args[2]
         logger = Logger(log_file)
 
         organization = Organization.objects.get(name=organization_name)
-        self.media_dir = settings.MEDIA_ROOT + organization.name
+        department = Department.objects.get(name=department_name,
+                                            organization=organization)
+        self.media_dir = settings.MEDIA_ROOT + organization.name + os.sep + department_name
         file_list = []
         all_conferences = Conference.objects.all()
         i = 1
@@ -81,9 +84,6 @@ class Command(BaseCommand):
                     path = dir + os.sep + filename
                     collection_id = '_'.join([department_name, course_id, course_type])
 
-                    department = Department.objects.filter(name=department_name,
-                                                           organization=organization)
-
                     if Conference.objects.filter(public_id=public_id) and department:
                         conference = Conference.objects.get(public_id=public_id)
                         department = Department.objects.get(name=department_name,