From: Gael Le Mignot Date: Tue, 22 May 2018 09:02:54 +0000 (+0200) Subject: Allowing annals with empty iej X-Git-Tag: 1.3~5 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=9aaa7a2b590a0793baa547c8230c642c129e5653;p=teleforma.git Allowing annals with empty iej --- diff --git a/teleforma/templates/teleforma/annals.html b/teleforma/templates/teleforma/annals.html index bd22be7e..e1402261 100644 --- a/teleforma/templates/teleforma/annals.html +++ b/teleforma/templates/teleforma/annals.html @@ -57,7 +57,7 @@
{% if not student %} -

{{ iej }}

+

{% if iej %}{{ iej }}{% else %}National{% endif %}

{% endif %}
diff --git a/teleforma/views/crfpa.py b/teleforma/views/crfpa.py index 40e4359d..abf247fd 100644 --- a/teleforma/views/crfpa.py +++ b/teleforma/views/crfpa.py @@ -37,6 +37,7 @@ from registration.views import * from extra_views import CreateWithInlinesView, UpdateWithInlinesView, InlineFormSet from django.utils.translation import ugettext_lazy as _ from django.views.decorators.csrf import csrf_exempt +from django.db.models import Q def get_course_code(obj): @@ -349,7 +350,7 @@ class AnnalsView(ListView): docs = Document.objects.filter(is_annal=True).order_by('-annal_year') elif students: self.student = students[0] - docs = Document.objects.filter(is_annal=True, iej=self.student.iej).order_by('-annal_year') + docs = Document.objects.filter(is_annal=True).filter(Q(iej=self.student.iej) | Q(iej=None)).order_by('-annal_year') if iej: docs = docs.filter(iej=iej) if course: