Merge pull request #75 from miurahr/proposal_status

Display proposal result status in proposal admin change lists
This commit is contained in:
Patrick Altman 2015-06-18 23:04:29 -05:00
commit 91ae3de6df

View file

@ -8,6 +8,7 @@ from django.utils.translation import ugettext_lazy as _
from django.utils.timezone import now from django.utils.timezone import now
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.core.exceptions import ObjectDoesNotExist
import reversion import reversion
@ -124,6 +125,13 @@ class ProposalBase(models.Model):
def number(self): def number(self):
return str(self.pk).zfill(3) return str(self.pk).zfill(3)
@property
def status(self):
try:
return self.result.status
except ObjectDoesNotExist:
return _('Undecided')
def speakers(self): def speakers(self):
yield self.speaker yield self.speaker
speakers = self.additional_speakers.exclude( speakers = self.additional_speakers.exclude(