]> git.parisson.com Git - teleforma.git/commitdiff
fix no prof, fix course list
authorGuillaume Pellerin <yomguy@parisson.com>
Tue, 12 Nov 2013 16:21:30 +0000 (17:21 +0100)
committerGuillaume Pellerin <yomguy@parisson.com>
Tue, 12 Nov 2013 16:21:30 +0000 (17:21 +0100)
teleforma/templates/teleforma/inc/conference_list.html
teleforma/views/core.py

index 753fcea1e1cbcc5515f2cbdf8299bf145195808f..76e97b1a396044f3c9900c3350d8221437f8a293 100644 (file)
@@ -24,7 +24,9 @@
                     <dl class="listing" style="font-size: 1.2em;">
                     <dt>{% trans "Title" %}</dt><dd>{{ stream.conference.course.title }}</dd>
                     <dt>{% trans "Session" %}</dt><dd>{{ stream.conference.session }}</dd>
+                    {% if stream.conference.professor.user.username %}
                     <dt>{% trans "Professor" %}</dt><dd><a href="{% url telemeta-profile-detail stream.conference.professor.user.username %}" target="_blank">{{ stream.conference.professor }}</a></dd>
+                    {% endif %}
                     <dt>{% trans "Begin" %}</dt><dd>{{ stream.conference.date_begin }}</dd>
                     </dl>
                  </div>
@@ -48,4 +50,4 @@
     </table>
 </div>
 {% endif %}
-{% endwith %}
\ No newline at end of file
+{% endwith %}
index cdf15472e050f24ec09e88f375b2a727ab20eb17..21868392aa3fc9a2769accf4e9891cc7116241bb 100644 (file)
@@ -232,8 +232,9 @@ class CourseListView(CourseAccessMixin, ListView):
         return super(CourseListView, self).dispatch(*args, **kwargs)
 
     @jsonrpc_method('teleforma.get_course_list')
-    def get_course_list(request, department_id):
-        department = Department.objects.get(id=department_id)
+    def get_course_list(request, department_name):
+        from teleforma.models import Department
+        department = Department.objects.get(name=department_name)
         return [course.to_dict() for course in Course.objects.filter(department=department)]
 
     def pull(request, organization_name, department_name):