From 68e0434705cf7502bbbb47e33c9a81246f9208dc Mon Sep 17 00:00:00 2001 From: Guillaume Pellerin Date: Tue, 12 May 2015 01:07:41 +0200 Subject: [PATCH] remove quotas from script page and add metadata to admin list --- teleforma/admin.py | 3 --- teleforma/exam/admin.py | 3 ++- teleforma/exam/models.py | 2 +- teleforma/exam/templates/exam/scripts.html | 3 --- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/teleforma/admin.py b/teleforma/admin.py index bd7f5c00..24486e78 100644 --- a/teleforma/admin.py +++ b/teleforma/admin.py @@ -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'] diff --git a/teleforma/exam/admin.py b/teleforma/exam/admin.py index 4c857c42..bcf2a9de 100644 --- a/teleforma/exam/admin.py +++ b/teleforma/exam/admin.py @@ -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'] diff --git a/teleforma/exam/models.py b/teleforma/exam/models.py index 15df1ca3..abffe972 100644 --- a/teleforma/exam/models.py +++ b/teleforma/exam/models.py @@ -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: diff --git a/teleforma/exam/templates/exam/scripts.html b/teleforma/exam/templates/exam/scripts.html index e4d579f2..a51d712b 100644 --- a/teleforma/exam/templates/exam/scripts.html +++ b/teleforma/exam/templates/exam/scripts.html @@ -25,9 +25,6 @@
  • {% trans "Pending" %}{% if user.is_staff or user.quotass.all %}{% untreated_scripts_count user period %}{% endif %}
  • {% trans "Marked" %}{% if not user.is_staff and not user.quotas.all %}{% treated_scripts_count user period %}{% endif %}
  • {% trans "Rejected" %}
  • - {% if user.is_staff or user.is_superuser %} -
  • {% trans "Quotas" %}
  • - {% endif %} {% endblock courses %} -- 2.39.5