]> git.parisson.com Git - teleforma.git/commitdiff
again
authorGuillaume Pellerin <yomguy@parisson.com>
Tue, 17 Sep 2013 16:47:47 +0000 (18:47 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Tue, 17 Sep 2013 16:47:47 +0000 (18:47 +0200)
teleforma/management/commands/teleforma-pull-courses.py
teleforma/views/core.py

index 2360b02b37ab7014c13d65a09d028c9a250a386d..9835cd4bfc4c7ca4d553cad9521dc3a2153dadfd 100644 (file)
@@ -17,7 +17,7 @@ class Command(BaseCommand):
     args = "organization_name department_name"
 
     def handle(self, *args, **options):
-       organization_name = args[0]
-       department_name = args[1]
+       organization_name = args[-2]
+       department_name = args[-1]
         view = CourseListView()
         view.pull(organization_name, department_name)
index ea1c0e3a7964e47c01bcdcc8352071829bde3ca5..1664e837d11251f30f152cb69195e2788254a20f 100644 (file)
@@ -240,7 +240,7 @@ class CourseListView(CourseAccessMixin, ListView):
         department = Department.objects.get(organization=organization, name=department_name)
         return [course.to_dict() for course in Course.objects.filter(department=department)]
 
-    def pull(organization_name, department_name):
+    def pull(request, organization_name, department_name):
         organization = Organization.objects.get(name=organization_name)
         department = Department.objects.get(name=department_name, organization=organization)
         url = 'http://' + department.domain + '/json/'