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 get_officer(position_name):
|
||||
def get_officers(position_name) -> list[SCHAOfficer]:
|
||||
try:
|
||||
return SCHAOfficer.objects.get(position=position_name)
|
||||
return SCHAOfficer.objects.filter(position=position_name)
|
||||
except:
|
||||
return None
|
||||
|
||||
officers = [
|
||||
get_officer("President"),
|
||||
get_officer("1st Vice President"),
|
||||
get_officer("2nd Vice President"),
|
||||
get_officer("Treasurer"),
|
||||
get_officer("Secretary"),
|
||||
get_officer("Website"),
|
||||
get_officer("Membership"),
|
||||
get_officer("Directory"),
|
||||
get_officer("Facebook"),
|
||||
get_officer("Eblasts"),
|
||||
]
|
||||
officers = []
|
||||
for position in ["President","1st Vice President",
|
||||
"2nd Vice President",
|
||||
"Treasurer",
|
||||
"Secretary",
|
||||
"Website",
|
||||
"Membership",
|
||||
"Directory",
|
||||
"Facebook",
|
||||
"Eblasts"]:
|
||||
officers += get_officers(position)
|
||||
|
||||
return render(request, "schasite/scha_board2.html", {"officers": officers})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user