Skip to content

Commit ae5e99e

Browse files
committed
Update summary table
1 parent a588a07 commit ae5e99e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

electives/controller.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -404,8 +404,16 @@ def generate_summary_table():
404404
for elective in electives:
405405
elective_data = defaultdict(str)
406406
for kind in elective.kinds.all():
407-
elective_data[kind.long_name] = elective.studentonelective_set.filter(
408-
kind=kind
407+
filtered_data = elective.studentonelective_set.filter(
408+
kind=kind,
409+
)
410+
elective_data[kind.long_name] = filtered_data.filter(
411+
attached=True,
412+
).aggregate(
413+
count=Count('student__id', distinct=True)
414+
)['count']
415+
elective_data[f'MAYBE {kind.long_name}'] = filtered_data.filter(
416+
attached=False,
409417
).aggregate(
410418
count=Count('student__id', distinct=True)
411419
)['count']

0 commit comments

Comments
 (0)