remove the add/delete of answers in the ticket
@@ -7,6 +7,7 @@ class UserAnswersInline(admin.TabularInline):
model = UserAnswer
fields = ("question", "answer_choice")
readonly_fields = ("question", "answer_choice")
+ can_delete = False
def question(self, instance):
return instance.answer.question
@@ -18,6 +19,9 @@ class UserAnswersInline(admin.TabularInline):
answer_choice.short_description = "Answer"
+ def has_add_permission(self, request):
+ return False
+
@admin.register(Ticket)
class TicketAdmin(admin.ModelAdmin):
