Skip to content

Commit

Permalink
Fix actions definition for v4.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DanSheps committed May 27, 2024
1 parent 3eb156e commit 2b5c710
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
14 changes: 12 additions & 2 deletions netbox_lifecycle/views/contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@ class SupportContractAssignmentView(ObjectChildrenView):
child_model = SupportContractAssignment
table = SupportContractAssignmentTable
filterset = SupportContractAssignmentFilterSet
actions = ['add', 'edit', 'delete']
actions = {
'add': {'add'},
'edit': {'change'},
'delete': {'delete'}
}
tab = ViewTab(
label='Assignments',
badge=lambda obj: SupportContractAssignment.objects.filter(contract=obj).count(),
Expand Down Expand Up @@ -140,7 +144,13 @@ class SupportContractAssignmentListView(ObjectListView):
table = SupportContractAssignmentTable
filterset = SupportContractAssignmentFilterSet
filterset_form = SupportContractAssignmentFilterForm
actions = ['add', 'edit', 'delete', 'bulk_edit', 'bulk_delete']
actions = {
'add': {'add'},
'edit': {'change'},
'delete': {'delete'},
'bulk_edit': {'change'},
'bulk_delete': {'delete'}
}


class SupportContractAssignmentBulkEditView(BulkEditView):
Expand Down
6 changes: 5 additions & 1 deletion netbox_lifecycle/views/license.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ class LicenseAssignmentView(ObjectChildrenView):
table = LicenseAssignmentTable
filterset = LicenseAssignmentFilterSet
viewname = None
actions = ['add', 'edit', 'delete']
actions = {
'add': {'add'},
'edit': {'change'},
'delete': {'delete'}
}
tab = ViewTab(
label='License Assignments',
badge=lambda obj: LicenseAssignment.objects.filter(license=obj).count(),
Expand Down

0 comments on commit 2b5c710

Please sign in to comment.