Commit 00d99502 authored by Luko van der Maas's avatar Luko van der Maas
Browse files

added new automatic lists for all previous boardss

parent 379ae9a1
from django.conf import settings
from django.utils import timezone
from activemembers.models import CommitteeMembership, Mentorship
from activemembers.models import CommitteeMembership, Mentorship, Board
from members.models import Member
from utils.snippets import datetime_to_lectureyear
......@@ -52,6 +52,20 @@ def get_automatic_lists():
profile__receive_optin=True),
multilingual=True)
for year in range(Board.objects.earliest('since').since.year, lectureyear):
board = Board.objects.get(since__year=year)
if board is not None:
lists += _create_automatic_list(
['bestuur'
+ str(board.since.year)[-2:] + str(board.until.year)[-2:],
'board'
+ str(board.since.year)[-2:] + str(board.until.year)[-2:]],
'',
[x.member for x in CommitteeMembership.objects
.filter(committee=board).prefetch_related('member')],
archived=False, moderated=False, multilingual=False
)
return lists
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment