Verified Commit 4d95e4b8 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Add automatic lists for mentors and active members

parent f12d54e3
from activemembers.models import CommitteeMembership
from django.utils import timezone
from activemembers.models import CommitteeMembership, Mentorship
from members.models import Member
from thaliawebsite.settings import settings
from utils.snippets import datetime_to_lectureyear
def get_automatic_lists():
......@@ -10,8 +13,16 @@ def get_automatic_lists():
committee_chairs = [x.member for x in memberships]
# name, prefix, members, archived, moderated, multilingual
active_committee_memberships = (CommitteeMembership.active_memberships
active_members = [x.member for x in active_committee_memberships]
active_mentorships = Mentorship.objects.filter(
mentors = [x.member for x in active_mentorships]
# name, prefix, members, archived, moderated, multilingual
lists = [
('leden', '[THALIA]', Member.all_with_membership(
'member', 'user'), True, True, True),
......@@ -25,7 +36,11 @@ def get_automatic_lists():
'supporter', 'user'), True, True, True),
('honorary', '[THALIA]', Member.all_with_membership(
'honorary', 'user'), True, True, True),
('commissievoorzitters', '[THALIA] [VOORZITTERS]',
('mentors', '[THALIA] [MENTORS]',
mentors, True, False, False),
('activemembers', '[THALIA] [COMMITTEES]',
active_members, True, True, False),
('commissievoorzitters', '[THALIA] [CHAIRS]',
committee_chairs, True, False, False),
('optin', '[THALIA] [OPTIN]', Member.active_members.filter(
receive_optin=True).prefetch_related('user'), True, True, False),
Supports Markdown
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