Skip to content

Commit

Permalink
Fixed the 'double click' add bug when creating a committee structure.
Browse files Browse the repository at this point in the history
  • Loading branch information
raghavio committed Jul 10, 2016
1 parent ce72ac0 commit 73cc763
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cleansweep/plugins/committees/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,8 @@ def validate_slug(self, field):
raise validators.ValidationError("There is already a committee in {} with same slug.".format(self.place.key))

def ensure_empty_slots(self, n=5):
# Ensure that there are at least 5 empty slots
empty_slots = sum(1 for role in self.data['roles'] if not role['name'].strip())
for i in range(n-empty_slots):
# Ensure that there are at least 5 <s>empty</s> slots
for i in range(n - len(self.roles)):
self.roles.append_entry()

def load(self, committee_structure):
Expand Down

0 comments on commit 73cc763

Please sign in to comment.