From 79f97d9b8be335a69c931e31944e9bc02c5604cd Mon Sep 17 00:00:00 2001 From: smith Date: Wed, 30 Aug 2023 12:00:36 -0400 Subject: [PATCH] 394 - Add verbose choices to 'Is Accepted' * Added Accepted (True), Rejected (False) and Pending (None) as choices for boolean 'Is accepted' --- moderator/moderate/models.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/moderator/moderate/models.py b/moderator/moderate/models.py index 5b40410..3d82072 100644 --- a/moderator/moderate/models.py +++ b/moderator/moderate/models.py @@ -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( @@ -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,