Skip to content

Commit

Permalink
add option to hide note column
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvw committed Aug 22, 2024
1 parent 91d17e2 commit 5287ead
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions edc_qareports/modeladmin_mixins/qa_report_modeladmin_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class QaReportModelAdminMixin:
note_model = "edc_qareports.note"
note_status_list_filter = NoteStatusListFilter
note_template = "edc_qareports/columns/notes_column.html"
include_note_column = True

@property
def note_model_cls(self):
Expand All @@ -46,8 +47,9 @@ def changelist_view(self, request, extra_context=None):
def get_list_display(self, request):
list_display = super().get_list_display(request)
list_display = list(list_display)
list_display.insert(self.qa_report_list_display_insert_pos, "notes")
list_display.insert(self.qa_report_list_display_insert_pos, "status")
if self.include_note_column:
list_display.insert(self.qa_report_list_display_insert_pos, "notes")
list_display.insert(self.qa_report_list_display_insert_pos, "status")
return tuple(list_display)

def get_list_filter(self, request):
Expand Down

0 comments on commit 5287ead

Please sign in to comment.