Professor name is effectively required, so might as well say so. Also fix how profess...
authorCharles Connell <charles@connells.org>
Mon, 14 Apr 2014 21:05:20 +0000 (17:05 -0400)
committerCharles Connell <charles@connells.org>
Mon, 14 Apr 2014 21:05:20 +0000 (17:05 -0400)
karmaworld/apps/courses/forms.py
karmaworld/templates/courses/course_detail.html

index d15bcda0112643767b031587181a84efef709dd6..4cfb4451601a62c93e42f9f00d7e3a73e97e79f1 100644 (file)
@@ -34,9 +34,9 @@ class ProfessorForm(NiceErrorModelForm, ACFieldModelForm):
 
     # first argument is ajax channel name, defined in models as LookupChannel.
     name = AutoCompleteSelectField('professor_object_by_name', help_text='',
-        label="Professor's name",
+        label=mark_safe('Professor\'s name <span class="required-field">(required)</span>'),
         # allows creating a new Professor on the fly
-        required=False,
+        required=True,
         widget=AutoCompleteSelectWidget('professor_object_by_name', attrs={'class': 'small-6 columns'}))
     email = AutoCompleteSelectField('professor_object_by_email', help_text='',
         label="Professor's email address",
index f513b26d003bf58bb61b1a4c9d1b5a7db4a62e54..c00fec2ab91607213d45c644a55a2b19aafe1dd2 100644 (file)
           {% if course.instructor_name %}
             <span id="course-header-instructor">{{ course.instructor_name }}</span>
           {% else %}
-            <span id="course-header-instructor">{{ course.instructor.name }}</span>
+            <span id="course-header-instructor">
+              {% for prof in course.professor.all %}
+                {{ prof.name }}{% if not forloop.last %},{% endif %}
+              {% endfor %}
+            </span>
           {% endif %}
         </div>
       </div>