Generic list only displays edit button if user has perm

This commit is contained in:
2020-10-12 21:38:31 +01:00
parent b69883cc90
commit e926731e67
3 changed files with 6 additions and 0 deletions

View File

@@ -218,6 +218,7 @@ class SupplierList(GenericListView):
context = super(SupplierList, self).get_context_data(**kwargs)
context['create'] = 'supplier_create'
context['edit'] = 'supplier_update'
context['can_edit'] = self.request.user.has_perm('assets.change_supplier')
context['detail'] = 'supplier_detail'
if self.request.is_ajax():
context['override'] = "base_ajax.html"