From: Guillaume Pellerin Date: Thu, 11 Jul 2013 10:48:47 +0000 (+0200) Subject: fix prof profile X-Git-Tag: 1.1~575 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=00e6402ffc0fef4205aee1fcff3715c933fa73f0;p=teleforma.git fix prof profile --- diff --git a/teleforma/views/core.py b/teleforma/views/core.py index 1abf569d..038fbc5a 100644 --- a/teleforma/views/core.py +++ b/teleforma/views/core.py @@ -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()