From 3b0e325390a37df5c1c9c2be0ea17759edd8ce1c Mon Sep 17 00:00:00 2001 From: Ben Adida <ben@adida.net> Date: Sun, 10 Nov 2013 16:35:45 -0800 Subject: [PATCH] stricter more robust code to prevent error in constraint checking --- helios/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helios/models.py b/helios/models.py index 085db4e..64733fa 100644 --- a/helios/models.py +++ b/helios/models.py @@ -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: -- GitLab