]> git.parisson.com Git - teleforma.git/commitdiff
remove quotas from script page and add metadata to admin list
authorGuillaume Pellerin <yomguy@parisson.com>
Mon, 11 May 2015 23:07:41 +0000 (01:07 +0200)
committerGuillaume Pellerin <yomguy@parisson.com>
Mon, 11 May 2015 23:07:41 +0000 (01:07 +0200)
teleforma/admin.py
teleforma/exam/admin.py
teleforma/exam/models.py
teleforma/exam/templates/exam/scripts.html

index bd7f5c0034d9b533b42ab10f918d58f8612ea56d..24486e7851cc70e4a3f58cc2366eeffeae0fb703 100644 (file)
@@ -119,9 +119,6 @@ class CourseAdmin(admin.ModelAdmin):
     model = Course
     ordering = ['number']
 
-class QuotaAdmin(admin.ModelAdmin):
-    model = Quota
-
 class DocumentAdmin(admin.ModelAdmin):
     exclude = ['readers']
     filter_horizontal = ['course_type']
index 4c857c4213dfd8efc36cdf95994021b3542e9622..bcf2a9ded2e1df0015aa429e7d9654ed69a281de 100644 (file)
@@ -15,7 +15,8 @@ class QuotaAdmin(admin.ModelAdmin):
     model= Quota
     form = QuotaAdminForm
     list_display = ['corrector_name', 'course', 'date_start', 'date_end',
-                    'pending_script_count', 'marked_script_count', 'all_script_count', 'value']
+                    'pending_script_count', 'marked_script_count',
+                    'all_script_count', 'value', 'level']
     list_filter = ['course__title']
     search_fields = ['corrector__username', 'corrector__last_name']
 
index 15df1ca3a805a676aff2344f62915189e4c57dfe..abffe972d83a2652acdc5c5094db1b3c5e734a46 100644 (file)
@@ -166,7 +166,7 @@ class Quota(models.Model):
         if self.value:
             if self.value != 0:
                 level = 100*self.all_script_count/self.value
-                return level
+                return round(level, 2)
             else:
                 return 0
         else:
index e4d579f20be5ee593e01f20f8f582bc0fa809ce1..a51d712b956c2eaadf2d189a42bc265e8c3beedf 100644 (file)
@@ -25,9 +25,6 @@
    <li><a href="{% url teleforma-exam-scripts-pending period.id %}">{% trans "Pending" %}{% if user.is_staff or user.quotass.all %}{% untreated_scripts_count user period %}{% endif %}</a></li>
    <li><a href="{% url teleforma-exam-scripts-treated period.id %}">{% trans "Marked" %}{% if not user.is_staff and not user.quotas.all %}{% treated_scripts_count user period %}{% endif %}</a></li>
    <li><a href="{% url teleforma-exam-scripts-rejected period.id %}">{% trans "Rejected" %}</a></li>
-   {% if user.is_staff or user.is_superuser %}
-    <li><a href="{% url teleforma-exam-quotas period.id %}">{% trans "Quotas" %}</a></li>
-   {% endif %}
   {% endblock courses %}
   </ul>
  </div>