Skip to content

Commit 5aba98a

Browse files
committed
Add proposal comment type
1 parent 562a550 commit 5aba98a

3 files changed

Lines changed: 31 additions & 2 deletions

File tree

junction/base/constants.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,9 @@ class ConferenceSettingConstants:
9696
ALLOW_PLUS_ZERO_REVIEWER_VOTE = {"name": "allow_plus_zero_reviewer_vote",
9797
"value": True,
9898
"description": "Allow +0 vote in reviewer votes"}
99+
100+
101+
@choices
102+
class ProposalCommentType:
103+
_GENERAL = [0, 'Unclassified']
104+
_SECOND_PHASE_VOTING = [1, 'Second phase voting']
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# -*- coding: utf-8 -*-
2+
from __future__ import unicode_literals
3+
4+
from django.db import models, migrations
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
('proposals', '0016_auto_20160221_0240'),
11+
]
12+
13+
operations = [
14+
migrations.AddField(
15+
model_name='proposalcomment',
16+
name='type',
17+
field=models.PositiveSmallIntegerField(default=0, choices=[(0, 'Unclassified'), (1, 'Second phase voting')]),
18+
preserve_default=True,
19+
),
20+
]

junction/proposals/models.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
from simple_history.models import HistoricalRecords
1616

1717
# Junction Stuff
18-
from junction.base.constants import ProposalReviewStatus, ProposalStatus, ProposalTargetAudience, ProposalUserVoteRole
18+
from junction.base.constants import (
19+
ProposalReviewStatus, ProposalStatus, ProposalTargetAudience, ProposalUserVoteRole,
20+
ProposalCommentType
21+
)
1922
from junction.base.models import AuditModel, TimeAuditModel
2023
from junction.conferences.models import Conference, ConferenceProposalReviewer
2124

@@ -268,7 +271,7 @@ class ProposalComment(TimeAuditModel):
268271
vote = models.BooleanField(default=False, verbose_name="What is the reason?")
269272
comment = models.TextField()
270273
deleted = models.BooleanField(default=False, verbose_name="Is Deleted?")
271-
274+
type = models.PositiveSmallIntegerField(choices=ProposalCommentType.CHOICES, default=ProposalCommentType.GENERAL)
272275
objects = ProposalCommentQuerySet.as_manager()
273276

274277
def __str__(self):

0 commit comments

Comments
 (0)