Skip to content

Commit

Permalink
add Support Issue to admin
Browse files Browse the repository at this point in the history
  • Loading branch information
muhuchah committed Jun 10, 2024
1 parent b78f773 commit e604510
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions Karoo_BackEnd/Karoo_BackEnd/support/admin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
from django.contrib import admin
from .models import SpamReport, Message
from .models import SpamReport, Message, SupportIssue

admin.site.register(SpamReport)
admin.site.register(Message)
admin.site.register(Message)

class SupportIssueAdmin(admin.ModelAdmin):
list_display = ('user', 'topic', 'message', 'timestamp', 'reply')
list_filter = ('user', 'timestamp')
search_fields = ('user__full_name', 'topic', 'message', 'reply')

admin.site.register(SupportIssue, SupportIssueAdmin)
2 changes: 1 addition & 1 deletion Karoo_BackEnd/Karoo_BackEnd/support/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ class Meta:

def __str__(self):
if self.reply == "NO REPLY":
return f"by {self.user.username} on {self.timestamp.strftime('%Y-%m-%d %H:%M:%S')}"
return f"by {self.user.full_name} on {self.timestamp.strftime('%Y-%m-%d %H:%M:%S')}"
else:
return f"Replied. Topic: {self.topic}"

0 comments on commit e604510

Please sign in to comment.