Skip to content

Commit 20d4710

Browse files
committed
Fix class property reference for py3
1 parent 3724871 commit 20d4710

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pgcommitfest/commitfest/forms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class CommentForm(forms.Form):
9898
review_doc = reviewfield('Documentation')
9999

100100
message = forms.CharField(required=True, widget=forms.Textarea)
101-
newstatus = forms.ChoiceField(choices=PatchOnCommitFest.OPEN_STATUS_CHOICES, label='New status')
101+
newstatus = forms.ChoiceField(choices=PatchOnCommitFest.OPEN_STATUS_CHOICES(), label='New status')
102102

103103
def __init__(self, patch, poc, is_review, *args, **kwargs):
104104
super(CommentForm, self).__init__(*args, **kwargs)

pgcommitfest/commitfest/models.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,10 @@ class PatchOnCommitFest(models.Model):
183183
(STATUS_WITHDRAWN, 'danger'),
184184
)
185185
OPEN_STATUSES = [STATUS_REVIEW, STATUS_AUTHOR, STATUS_COMMITTER]
186-
OPEN_STATUS_CHOICES = [x for x in _STATUS_CHOICES if x[0] in OPEN_STATUSES]
186+
187+
@classmethod
188+
def OPEN_STATUS_CHOICES(cls):
189+
return [x for x in cls._STATUS_CHOICES if x[0] in cls.OPEN_STATUSES]
187190

188191
patch = models.ForeignKey(Patch, blank=False, null=False)
189192
commitfest = models.ForeignKey(CommitFest, blank=False, null=False)

0 commit comments

Comments
 (0)