pedagogy: Fix grade range on UVCOmment

This commit is contained in:
Antoine Bartuccio 2019-06-17 18:12:21 +02:00
parent 5ccb499665
commit d44fa73b2a
Signed by: klmp200
GPG Key ID: E7245548C53F904B
3 changed files with 15 additions and 15 deletions

View File

@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-06-16 14:22
# Generated by Django 1.11.20 on 2019-06-17 16:08
from __future__ import unicode_literals
from django.conf import settings
@ -202,7 +202,7 @@ class Migration(migrations.Migration):
default=-1,
validators=[
django.core.validators.MinValueValidator(-1),
django.core.validators.MaxValueValidator(5),
django.core.validators.MaxValueValidator(4),
],
verbose_name="global grade",
),
@ -213,7 +213,7 @@ class Migration(migrations.Migration):
default=-1,
validators=[
django.core.validators.MinValueValidator(-1),
django.core.validators.MaxValueValidator(5),
django.core.validators.MaxValueValidator(4),
],
verbose_name="utility grade",
),
@ -224,7 +224,7 @@ class Migration(migrations.Migration):
default=-1,
validators=[
django.core.validators.MinValueValidator(-1),
django.core.validators.MaxValueValidator(5),
django.core.validators.MaxValueValidator(4),
],
verbose_name="interest grade",
),
@ -235,7 +235,7 @@ class Migration(migrations.Migration):
default=-1,
validators=[
django.core.validators.MinValueValidator(-1),
django.core.validators.MaxValueValidator(5),
django.core.validators.MaxValueValidator(4),
],
verbose_name="teaching grade",
),
@ -246,7 +246,7 @@ class Migration(migrations.Migration):
default=-1,
validators=[
django.core.validators.MinValueValidator(-1),
django.core.validators.MaxValueValidator(5),
django.core.validators.MaxValueValidator(4),
],
verbose_name="work load grade",
),

View File

@ -172,35 +172,35 @@ class UVComment(models.Model):
comment = models.TextField(_("comment"))
grade_global = models.IntegerField(
_("global grade"),
validators=[validators.MinValueValidator(-1), validators.MaxValueValidator(5)],
validators=[validators.MinValueValidator(-1), validators.MaxValueValidator(4)],
blank=False,
null=False,
default=-1,
)
grade_utility = models.IntegerField(
_("utility grade"),
validators=[validators.MinValueValidator(-1), validators.MaxValueValidator(5)],
validators=[validators.MinValueValidator(-1), validators.MaxValueValidator(4)],
blank=False,
null=False,
default=-1,
)
grade_interest = models.IntegerField(
_("interest grade"),
validators=[validators.MinValueValidator(-1), validators.MaxValueValidator(5)],
validators=[validators.MinValueValidator(-1), validators.MaxValueValidator(4)],
blank=False,
null=False,
default=-1,
)
grade_teaching = models.IntegerField(
_("teaching grade"),
validators=[validators.MinValueValidator(-1), validators.MaxValueValidator(5)],
validators=[validators.MinValueValidator(-1), validators.MaxValueValidator(4)],
blank=False,
null=False,
default=-1,
)
grade_work_load = models.IntegerField(
_("work load grade"),
validators=[validators.MinValueValidator(-1), validators.MaxValueValidator(5)],
validators=[validators.MinValueValidator(-1), validators.MaxValueValidator(4)],
blank=False,
null=False,
default=-1,

View File

@ -317,11 +317,11 @@ def create_uv_comment_template(user_id, uv_code="PA00", exclude_list=[]):
comment = {
"author": user_id,
"uv": UV.objects.get(code=uv_code).id,
"grade_global": 5,
"grade_utility": 5,
"grade_interest": 5,
"grade_global": 4,
"grade_utility": 4,
"grade_interest": 4,
"grade_teaching": -1,
"grade_work_load": 3,
"grade_work_load": 2,
"comment": "Superbe UV qui fait vivre la vie associative de l'école",
}
for excluded in exclude_list: