Skip to content

Commit

Permalink
simpler solution. Thanks 'snafu':
Browse files Browse the repository at this point in the history
  • Loading branch information
jedie committed Aug 10, 2012
1 parent 2436d67 commit 9a3c637
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions djangobb_forum/forms.py
Expand Up @@ -453,12 +453,7 @@ def create_poll(self):
"""
return True if one field filled with data -> the user wants to create a poll
"""
question = self.data.get("question")
answers = self.data.get("answers")
days = self.data.get("days")
if question or answers or days:
return True
return False
return any(self.data.get(key) for key in ('question', 'answers', 'days'))

def clean_answers(self):
# validate if there is more than whitespaces ;)
Expand Down

0 comments on commit 9a3c637

Please sign in to comment.