Commit 585214db authored by Thom Wiggers's avatar Thom Wiggers 📐
Browse files

Merge branch 'hotfix/1.2.1-fix-showcased-partners-missing-id' into 'release/1.3'

🚑 Fix 500 error when trying to display showcased partner that is removed

See merge request !307
parents c11a27da d38b119a
......@@ -13,6 +13,10 @@ def showcased_partners(request):
chosen, rest = sequence[:2], sequence[2:]
request.session['partner_sequence'] = rest + chosen
partners = tuple(Partner.objects.get(id=id) for id in chosen)
try:
partners = tuple(Partner.objects.get(id=id) for id in chosen)
except Partner.DoesNotExist:
del request.session['partner_sequence']
return showcased_partners(request)
return {'showcased_partners': partners}
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