]> git.parisson.com Git - teleforma.git/commitdiff
Allowing annals with empty iej
authorGael Le Mignot <gael@pilotsystems.net>
Tue, 22 May 2018 09:02:54 +0000 (11:02 +0200)
committerGael Le Mignot <gael@pilotsystems.net>
Tue, 22 May 2018 09:02:54 +0000 (11:02 +0200)
teleforma/templates/teleforma/annals.html
teleforma/views/crfpa.py

index bd22be7e87ee99ed9d7b19d35c6682ab8aacb73a..e14022617d05cd1cb96de86016db028c75f7d065 100644 (file)
@@ -57,7 +57,7 @@
 
                                <div class="course_subtitle">
                                        {% if not student %}
-                                       <h3><img src="/static//telemeta/images/item_title.png" width="10px" alt="" /> {{ iej }}</h3>
+                                       <h3><img src="/static//telemeta/images/item_title.png" width="10px" alt="" /> {% if iej %}{{ iej }}{% else %}National{% endif %}</h3>
                                        {% endif %}
                                </div>
 
index 40e4359de51e85321eb5b2851f851cee46a01776..abf247fd2643a4a0062553e572b1898bdd4af860 100644 (file)
@@ -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: