Commit 862cffdb authored by Jelle Besseling's avatar Jelle Besseling
Browse files

Test if main partner exists in career index view

parent 45b78962
......@@ -6,12 +6,16 @@ from random import random
def index(request):
partners = Partner.objects.filter(is_active=True, is_main_partner=False)
context = {
'main_partner': Partner.objects.get(
try:
main_parter = Partner.objects.get(
is_active=True,
is_main_partner=True
),
)
except:
mainpartner = None
context = {
'main_partner': main_partner,
'partners': sorted(partners, key=lambda x: random()),
}
return render(request, 'partners/index.html', context)
......
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