]> git.parisson.com Git - teleforma.git/commitdiff
fix script links
authorGuillaume Pellerin <yomguy@parisson.com>
Fri, 18 Jul 2014 10:06:31 +0000 (12:06 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Fri, 18 Jul 2014 10:06:31 +0000 (12:06 +0200)
teleforma/exam/models.py
teleforma/exam/templates/exam/inc/script_list.html

index a6e399b40d5ce2b90adf618ac0f69575dd13f31a..1d020cadd6c3eb1c6296d2891150b110affb3f35 100644 (file)
@@ -290,9 +290,12 @@ class Script(BaseResource):
         new_abs = os.sep.join(old_abs_root) + os.sep + slugify(filename) + ext
         new_rel = os.sep.join(old_rel_root) + os.sep + slugify(filename) + ext
 
-        os.rename(old_abs, new_abs)
+        print new_abs
+        print new_rel
+
+        # os.rename(old_abs, new_abs)
         self.file = new_rel
-        self.save()
+        self.save()
 
     def submit(self):
         self.date_submitted = datetime.datetime.now()
index d00c88c90917fa4614986c5da21ffca32aa0a2d3..0ce9d1123e6bc8c22a3c56f8b2bc69c8435c57a8 100644 (file)
     <tbody id="spacing" class="script-list">
     {% for script in object_list %}
     <tr>
-     <td {% if script.status != 2 %}href="{% url teleforma-exam-script-detail period.id script.id %}"{% endif %}>{{ script.course.title }}</td>
-     <td {% if script.status != 2 %}href="{% url teleforma-exam-script-detail period.id script.id %}"{% endif %}>{{ script.session }}</td>
-     <td {% if script.status != 2 %}href="{% url teleforma-exam-script-detail period.id script.id %}"{% endif %}>{{ script.type }}</td>
-     <td>{{ script.author.last_name }}</td>
-     <td>{{ script.author.first_name }}</td>
+     <td>{% if script.status != 2 %}<a href="{% url teleforma-exam-script-detail period.id script.id %}">{% endif %}{{ script.course.title }}{% if script.status != 2 %}</a>{% endif %}</td>
+     <td>{% if script.status != 2 %}<a href="{% url teleforma-exam-script-detail period.id script.id %}">{% endif %}{{ script.session }}{% if script.status != 2 %}</a>{% endif %}</td>
+     <td>{% if script.status != 2 %}<a href="{% url teleforma-exam-script-detail period.id script.id %}">{% endif %}{{ script.type }}{% if script.status != 2 %}</a>{% endif %}</td>
+     <td><a href="{% url teleforma-profile-detail script.author.username %}">{{ script.author.last_name }}</a></td>
+     <td><a href="{% url teleforma-profile-detail script.author.username %}">{{ script.author.first_name }}</a></td>
      <td>{{ script.date_added }}</td>
      <td>{% if script.date_marked %}{{ script.date_marked }}{% endif %}</td>
      <td>{% if script.corrector %}{{ script.corrector }}{% endif %}</td>