From: Guillaume Pellerin Date: Wed, 29 Jan 2014 16:26:31 +0000 (+0100) Subject: update conf import X-Git-Tag: 1.1~496 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=c9dee0811a1ae7e33880df64fd528a7bb603fddf;p=teleforma.git update conf import --- diff --git a/teleforma/management/commands/teleforma-import-conferences.py b/teleforma/management/commands/teleforma-import-conferences.py index efeeb219..829b18dd 100644 --- a/teleforma/management/commands/teleforma-import-conferences.py +++ b/teleforma/management/commands/teleforma-import-conferences.py @@ -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,