]> git.parisson.com Git - teleforma.git/commitdiff
fix prof profile
authorGuillaume Pellerin <yomguy@parisson.com>
Thu, 11 Jul 2013 10:48:47 +0000 (12:48 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Thu, 11 Jul 2013 10:48:47 +0000 (12:48 +0200)
teleforma/views/core.py

index 1abf569d23b567edc05b2c79bf4494f071e4a8cd..038fbc5ac8bbf1682374f07a7cf74e2752639862 100644 (file)
@@ -611,8 +611,9 @@ class ProfessorListView(View):
             professor, c = Professor.objects.get_or_create(user=user)
             for course_code in professor_dict['courses']:
                 course = Course.objects.filter(code=course_code)
-                if course and not course in professor.courses.all():
-                    professor.courses.add(course[0])
+                if course:
+                    if not course[0] in professor.courses.all():
+                        professor.courses.add(course[0])
             professor.save()