Unverified Commit 0c4753de authored by Thom Wiggers's avatar Thom Wiggers 📐
Browse files

Remove unnecessary exception handling

Also now does it with a list comprehension as the tuple just
consumes the generator anyway.
parent 47982138
......@@ -28,10 +28,6 @@ def showcased_partners(request):
chosen, rest = sequence[:2], sequence[2:]
request.session['partner_sequence'] = rest + chosen
try:
partners = tuple(p for p in all_partners if p.id in chosen)
except Partner.DoesNotExist:
del request.session['partner_sequence']
return showcased_partners(request)
return {'showcased_partners': partners}
return {
'showcased_partners': [p for p in all_partners if p.id in chosen],
}
Markdown is supported
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