allow to save an empty poll

This commit is contained in:
Oskar Hahn 2012-06-24 22:34:11 +02:00
parent 48c53d3cd0
commit 4339c3ae8a
2 changed files with 2 additions and 1 deletions

View File

@ -32,4 +32,5 @@ class OptionForm(forms.Form, CssClassMixin):
label=value,
initial=weight,
min_value=-2,
required=False,
)

View File

@ -33,7 +33,7 @@ class TextOption(BaseOption):
class Vote(models.Model):
option = models.ForeignKey(BaseOption)
#profile = models.ForeignKey(Profile) # TODO: we need a person+ here
weight = models.IntegerField(default=1)
weight = models.IntegerField(default=1, null=True)
value = models.CharField(max_length=255, null=True)
def get_weight(self, raw=False):