undocumentet poll results
This commit is contained in:
parent
475b7a1ffe
commit
7be90c89c7
@ -71,7 +71,7 @@ class Poll(models.Model):
|
|||||||
if self.assignment:
|
if self.assignment:
|
||||||
return Poll.objects.filter(assignment=self.assignment).count()
|
return Poll.objects.filter(assignment=self.assignment).count()
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def ballot(self):
|
def ballot(self):
|
||||||
if self.application:
|
if self.application:
|
||||||
@ -125,6 +125,8 @@ class Option(models.Model):
|
|||||||
def yes(self):
|
def yes(self):
|
||||||
if self.voteyes == -1:
|
if self.voteyes == -1:
|
||||||
return _('majority')
|
return _('majority')
|
||||||
|
if self.voteno == -2:
|
||||||
|
return _('undocumented')
|
||||||
if self.voteyes:
|
if self.voteyes:
|
||||||
return self.voteyes
|
return self.voteyes
|
||||||
return '0'
|
return '0'
|
||||||
@ -133,6 +135,8 @@ class Option(models.Model):
|
|||||||
def no(self):
|
def no(self):
|
||||||
if self.voteno == -1:
|
if self.voteno == -1:
|
||||||
return _('majority')
|
return _('majority')
|
||||||
|
if self.voteno == -2:
|
||||||
|
return _('undocumented')
|
||||||
if self.voteno:
|
if self.voteno:
|
||||||
return self.voteno
|
return self.voteno
|
||||||
return '0'
|
return '0'
|
||||||
@ -141,6 +145,8 @@ class Option(models.Model):
|
|||||||
def undesided(self):
|
def undesided(self):
|
||||||
if self.voteundesided == -1:
|
if self.voteundesided == -1:
|
||||||
return _('majority')
|
return _('majority')
|
||||||
|
if self.voteno == -2:
|
||||||
|
return _('undocumented')
|
||||||
if self.voteundesided:
|
if self.voteundesided:
|
||||||
return self.voteundesided
|
return self.voteundesided
|
||||||
return '0'
|
return '0'
|
||||||
@ -156,10 +162,6 @@ class Option(models.Model):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
if self.text != "" and self.text is not None:
|
if self.value:
|
||||||
return self.text
|
return self.value
|
||||||
if self.user is not None:
|
|
||||||
return unicode(self.user)
|
|
||||||
if self.application is not None:
|
|
||||||
return unicode(self.application)
|
|
||||||
return _("No options")
|
return _("No options")
|
||||||
|
Loading…
Reference in New Issue
Block a user