summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Hagander2019-02-06 18:58:48 +0000
committerMagnus Hagander2019-02-06 19:01:54 +0000
commit20d4710f4ca1a36f6194eaaf7880f39a2349ce53 (patch)
tree2271758531f82cccfec87494e7f276026bb176c5
parent37248717c373033626fae7396bc8ac47374abb30 (diff)
Fix class property reference for py3
-rw-r--r--pgcommitfest/commitfest/forms.py2
-rw-r--r--pgcommitfest/commitfest/models.py5
2 files changed, 5 insertions, 2 deletions
diff --git a/pgcommitfest/commitfest/forms.py b/pgcommitfest/commitfest/forms.py
index 1ab8269..85cec79 100644
--- a/pgcommitfest/commitfest/forms.py
+++ b/pgcommitfest/commitfest/forms.py
@@ -98,7 +98,7 @@ class CommentForm(forms.Form):
review_doc = reviewfield('Documentation')
message = forms.CharField(required=True, widget=forms.Textarea)
- newstatus = forms.ChoiceField(choices=PatchOnCommitFest.OPEN_STATUS_CHOICES, label='New status')
+ newstatus = forms.ChoiceField(choices=PatchOnCommitFest.OPEN_STATUS_CHOICES(), label='New status')
def __init__(self, patch, poc, is_review, *args, **kwargs):
super(CommentForm, self).__init__(*args, **kwargs)
diff --git a/pgcommitfest/commitfest/models.py b/pgcommitfest/commitfest/models.py
index b59d754..c9c9abe 100644
--- a/pgcommitfest/commitfest/models.py
+++ b/pgcommitfest/commitfest/models.py
@@ -183,7 +183,10 @@ class PatchOnCommitFest(models.Model):
(STATUS_WITHDRAWN, 'danger'),
)
OPEN_STATUSES = [STATUS_REVIEW, STATUS_AUTHOR, STATUS_COMMITTER]
- OPEN_STATUS_CHOICES = [x for x in _STATUS_CHOICES if x[0] in OPEN_STATUSES]
+
+ @classmethod
+ def OPEN_STATUS_CHOICES(cls):
+ return [x for x in cls._STATUS_CHOICES if x[0] in cls.OPEN_STATUSES]
patch = models.ForeignKey(Patch, blank=False, null=False)
commitfest = models.ForeignKey(CommitFest, blank=False, null=False)