Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRogelio Mita <rogeliomita@activitycentral.com>2013-06-13 15:07:53 (GMT)
committer Rogelio Mita <rogeliomita@activitycentral.com>2013-06-13 15:07:53 (GMT)
commit38f9ab4b9d5456f4ca1c48a1575995b8442e8710 (patch)
tree367236d46d9e0bd037be894943de26160ab5093b
parent755185811e1881fa3300b415f0570d0b01eff84a (diff)
BugFix: pollsters clean after close a poll.
-rw-r--r--webapp/polls/forms.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/webapp/polls/forms.py b/webapp/polls/forms.py
index 5a905ec..653789b 100644
--- a/webapp/polls/forms.py
+++ b/webapp/polls/forms.py
@@ -45,6 +45,10 @@ class PollForm(forms.Form):
return name
def clean_pollsters(self):
+ status = self.cleaned_data['status']
+ if status == Poll.CLOSED:
+ del self.cleaned_data['pollsters']
+ return None
return filter(lambda p: p, self.cleaned_data['pollsters'])
def save(self):
@@ -62,7 +66,9 @@ class PollForm(forms.Form):
# any type of mongo document
poll = Poll.get(id)
old_data = poll.to_python(with_dates=True)
+ print old_data
old_data.update(_data)
+ print old_data
_data = old_data
poll = Poll(data=_data)