mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-13 16:47:34 -06:00
This commit is contained in:
parent
5b86d5d52a
commit
dfd788c643
@ -260,11 +260,15 @@ class ActionsColumn(tables.Column):
|
||||
return ''
|
||||
|
||||
def render(self, record, table, **kwargs):
|
||||
# Skip dummy records (e.g. available VLANs) or those with no actions
|
||||
if not getattr(record, 'pk', None) or not (self.actions or self.extra_buttons):
|
||||
model = table.Meta.model
|
||||
|
||||
# Skip if no actions or extra buttons are defined
|
||||
if not (self.actions or self.extra_buttons):
|
||||
return ''
|
||||
# Skip dummy records (e.g. available VLANs or IP ranges replacing individual IPs)
|
||||
if type(record) is not model or not getattr(record, 'pk', None):
|
||||
return ''
|
||||
|
||||
model = table.Meta.model
|
||||
if request := getattr(table, 'context', {}).get('request'):
|
||||
return_url = request.GET.get('return_url', request.get_full_path())
|
||||
url_appendix = f'?return_url={quote(return_url)}'
|
||||
|
Loading…
Reference in New Issue
Block a user