Do not display archived students in attribution view
This commit is contained in:
parent
a0bcc21475
commit
8d8454ba56
2 changed files with 6 additions and 5 deletions
|
|
@ -149,12 +149,13 @@ def section_classes(request, pk):
|
|||
|
||||
def period_students(request, pk):
|
||||
"""
|
||||
Return all students from period's section and level,
|
||||
Return all active students from period's section and level,
|
||||
with corresponding Training if existing (JSON)
|
||||
"""
|
||||
period = get_object_or_404(Period, pk=pk)
|
||||
students = Student.objects.filter(klass__section=period.section, klass__level=period.relative_level
|
||||
).order_by('last_name')
|
||||
students = Student.objects.filter(
|
||||
archived=False, klass__section=period.section, klass__level=period.relative_level
|
||||
).order_by('last_name')
|
||||
trainings = dict((t.student_id, t.id) for t in Training.objects.filter(availability__period=period))
|
||||
data = [{
|
||||
'name': unicode(s),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue