Skip to content

Commit

Permalink
Hide "delete_run" column if non-shiftleader
Browse files Browse the repository at this point in the history
  • Loading branch information
nothingface0 committed Aug 1, 2022
1 parent cb0a5cc commit 9a4a95a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tables/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,14 @@ class ReferenceRunReconstructionTable(tables.Table):
def render_apv_mode(self, record):
return record.run.apv_mode

def before_render(self, request):
"""
Hook provided by django-tables especially for
conditionallly hiding columns
"""
if not request.user.has_shift_leader_rights:
self.columns.hide("delete_run")

class Meta:
model = RunReconstruction
fields = ()
Expand Down

0 comments on commit 9a4a95a

Please sign in to comment.