mirror of
https://github.com/netbox-community/netbox.git
synced 2025-12-22 05:12:22 -06:00
Fixed table form rendering for django-tables2>=1.2.1
This commit is contained in:
@@ -17,6 +17,10 @@ class BaseTable(tables.Table):
|
||||
'class': 'table table-hover',
|
||||
}
|
||||
|
||||
@property
|
||||
def model(self):
|
||||
return self._meta.model
|
||||
|
||||
|
||||
class ToggleColumn(tables.CheckBoxColumn):
|
||||
|
||||
|
||||
@@ -92,7 +92,6 @@ class ObjectListView(View):
|
||||
|
||||
# Construct the table based on the user's permissions
|
||||
table = self.table(self.queryset)
|
||||
table.model = model
|
||||
if 'pk' in table.base_columns and any([request.user.has_perm(perm) for perm in self.edit_permissions]):
|
||||
table.base_columns['pk'].visible = True
|
||||
RequestConfig(request, paginate={'klass': EnhancedPaginator}).configure(table)
|
||||
|
||||
Reference in New Issue
Block a user