Commit 024f805a authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Use python query instead of length to count elements

parent 1b6533e2
......@@ -40,8 +40,7 @@ def index(request):
obj.current_membership.since.year < start_year]
elif query_filter == 'ex':
members = [obj for obj in members if not obj.current_membership and
len([ship for ship in obj.membership_set.all().filter(
type='member')]) > 0]
obj.membership_set.all().filter(type='member').count() > 0]
elif query_filter == 'honor':
members = [obj for obj in members if
obj.current_membership and
......
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