diff --git a/ticketsystem/models.py b/ticketsystem/models.py index 6ff02fc..34e1319 100644 --- a/ticketsystem/models.py +++ b/ticketsystem/models.py @@ -27,6 +27,7 @@ class Ticket(models.Model): def __str__(self): return f"[{self.get_priority_display()}] {self.title} ({self.get_status_display()})" + class Comment(models.Model): ticket = models.ForeignKey("Ticket", on_delete=models.CASCADE, related_name="comments") author = models.ForeignKey(User, on_delete=models.CASCADE) diff --git a/ticketsystem/templates/ticketsystem/detail.html b/ticketsystem/templates/ticketsystem/detail.html index aae4d29..6153018 100644 --- a/ticketsystem/templates/ticketsystem/detail.html +++ b/ticketsystem/templates/ticketsystem/detail.html @@ -1,4 +1,17 @@ {% block content %} +{% if messages %} +
+ {% for message in messages %} +
+ {{ message }} +
+ {% endfor %} +
+{% endif %}