Skip to content
Snippets Groups Projects
Commit 3b0e3253 authored by Ben Adida's avatar Ben Adida
Browse files

stricter more robust code to prevent error in constraint checking

parent 79b77b12
No related branches found
No related tags found
No related merge requests found
......@@ -265,7 +265,7 @@ class Election(HeliosModel):
return []
# constraints that are relevant
relevant_constraints = [constraint['constraint'] for constraint in self.eligibility if constraint['auth_system'] == user_type]
relevant_constraints = [constraint['constraint'] for constraint in self.eligibility if constraint['auth_system'] == user_type and constraint.has_key('constraint')]
if len(relevant_constraints) > 0:
return relevant_constraints[0]
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment