From d63c5b4a6a869e8d59af425d81f8c692538b1253 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 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/moderator/moderate/models.py b/moderator/moderate/models.py index 5b40410..dbca6db 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,9 @@ 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,