Skip to content

Commit

Permalink
Merge branch 'release/0.3.65' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
erikvw committed Aug 29, 2024
2 parents ea9e838 + 2d87f6c commit 825da11
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion edc_sites/admin/site_model_admin_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,13 @@ def get_list_filter(self, request) -> tuple[str | Type[SimpleListFilter], ...]:

def get_list_display(self, request) -> tuple[str]:
"""Insert `site` after the first column"""
pos = self.site_list_display_insert_pos
list_display = super().get_list_display(request)
pos = self.site_list_display_insert_pos
if (
self.user_may_view_other_sites(request)
or self.has_viewallsites_permission(request)
) and "site" not in list_display:
list_display = tuple(list_display)
list_display = list_display[:pos] + (self.site_code,) + list_display[pos:]
elif "site" in list_display:
list_display = tuple(
Expand Down

0 comments on commit 825da11

Please sign in to comment.