Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a dropdown with options on the feedback form (backend changes) #1032

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions feedback/migrations/0005_feedback_category.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 4.2.9 on 2024-09-19 19:50

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("feedback", "0004_contentcurationrequest_created_at_and_more"),
]

operations = [
migrations.AddField(
model_name="feedback",
name="category",
field=models.TextField(blank=True, default=""),
),
]
2 changes: 2 additions & 0 deletions feedback/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ class Feedback(models.Model):
name = models.CharField(max_length=150)
email = models.EmailField()
subject = models.CharField(max_length=400)
category = models.TextField(default="", blank=True)
comments = models.TextField()
source = models.CharField(max_length=50, default="SDE", blank=True)
created_at = models.DateTimeField(null=True, blank=True)
Expand Down Expand Up @@ -37,6 +38,7 @@ def format_notification_message(self):
f"Name: {self.name}\n"
f"Email: {self.email}\n"
f"Subject: {self.subject}\n"
f"Feedback Category: {self.category}\n"
f"Comments: {self.comments}\n"
f"Source: {self.source}\n"
f"Received on: {self.created_at.strftime('%Y-%m-%d %H:%M:%S')}"
Expand Down
1 change: 1 addition & 0 deletions feedback/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Meta:
"name",
"email",
"subject",
"category",
"comments",
"source",
"created_at",
Expand Down