Allow for multiple entries on the scha board for positions
This commit is contained in:
@@ -148,24 +148,23 @@ def calendar2(request):
|
|||||||
|
|
||||||
|
|
||||||
def scha_board2(request):
|
def scha_board2(request):
|
||||||
def get_officer(position_name):
|
def get_officers(position_name) -> list[SCHAOfficer]:
|
||||||
try:
|
try:
|
||||||
return SCHAOfficer.objects.get(position=position_name)
|
return SCHAOfficer.objects.filter(position=position_name)
|
||||||
except:
|
except:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
officers = [
|
officers = []
|
||||||
get_officer("President"),
|
for position in ["President","1st Vice President",
|
||||||
get_officer("1st Vice President"),
|
"2nd Vice President",
|
||||||
get_officer("2nd Vice President"),
|
"Treasurer",
|
||||||
get_officer("Treasurer"),
|
"Secretary",
|
||||||
get_officer("Secretary"),
|
"Website",
|
||||||
get_officer("Website"),
|
"Membership",
|
||||||
get_officer("Membership"),
|
"Directory",
|
||||||
get_officer("Directory"),
|
"Facebook",
|
||||||
get_officer("Facebook"),
|
"Eblasts"]:
|
||||||
get_officer("Eblasts"),
|
officers += get_officers(position)
|
||||||
]
|
|
||||||
|
|
||||||
return render(request, "schasite/scha_board2.html", {"officers": officers})
|
return render(request, "schasite/scha_board2.html", {"officers": officers})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user