Skip to content

Commit

Permalink
394 - Add verbose choices to 'Is Accepted'
Browse files Browse the repository at this point in the history
* Added Accepted (True), Rejected (False) and Pending (None)
  as choices for boolean 'Is accepted'
  • Loading branch information
smithellis committed Aug 30, 2023
1 parent d4ea105 commit 79f97d9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions moderator/moderate/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ def questions_count(self):

class Question(models.Model):
"""Question relational model."""

ACCEPTANCE_CHOICES = [
(True, "Accepted"),
(False, "Rejected"),
(None, "Pending"),
]
asked_by = models.ForeignKey(User, null=True, blank=True, on_delete=models.SET_NULL)
event = models.ForeignKey(Event, related_name="questions", on_delete=models.CASCADE)
question = models.TextField(
Expand All @@ -102,7 +106,7 @@ class Question(models.Model):
is_anonymous = models.BooleanField(default=False, blank=False)
submitter_contact_info = models.EmailField(max_length=256, default="", blank=True)
# Default value is None, which means that moderation is still pending
is_accepted = models.BooleanField(blank=True, null=True)
is_accepted = models.BooleanField(blank=True, null=True, default=None, choices=ACCEPTANCE_CHOICES)
rejection_reason = models.TextField(
default="",
blank=True,
Expand Down

0 comments on commit 79f97d9

Please sign in to comment.