From adeb5e9162e8744ca3f637b08ed517bd934dafd2 Mon Sep 17 00:00:00 2001 From: jeremystretch Date: Fri, 24 Mar 2023 16:23:20 -0400 Subject: [PATCH] Remove ManagedFile views --- netbox/core/tables/__init__.py | 1 - netbox/core/tables/files.py | 25 ----------- netbox/core/urls.py | 4 -- netbox/core/views.py | 14 ------- netbox/netbox/navigation/menu.py | 1 - netbox/templates/core/managedfile.html | 57 -------------------------- 6 files changed, 102 deletions(-) delete mode 100644 netbox/core/tables/files.py delete mode 100644 netbox/templates/core/managedfile.html diff --git a/netbox/core/tables/__init__.py b/netbox/core/tables/__init__.py index e21b9f8cf..df22d8bbb 100644 --- a/netbox/core/tables/__init__.py +++ b/netbox/core/tables/__init__.py @@ -1,2 +1 @@ from .data import * -from .files import * diff --git a/netbox/core/tables/files.py b/netbox/core/tables/files.py deleted file mode 100644 index e1333c000..000000000 --- a/netbox/core/tables/files.py +++ /dev/null @@ -1,25 +0,0 @@ -import django_tables2 as tables - -from core.models import * -from netbox.tables import NetBoxTable, columns - -__all__ = ( - 'ManagedFileTable', -) - - -class ManagedFileTable(NetBoxTable): - file_path = tables.Column( - linkify=True - ) - last_updated = columns.DateTimeColumn() - actions = columns.ActionsColumn( - actions=('delete',) - ) - - class Meta(NetBoxTable.Meta): - model = ManagedFile - fields = ( - 'pk', 'id', 'file_root', 'file_path', 'last_updated', 'size', 'hash', - ) - default_columns = ('pk', 'file_root', 'file_path', 'last_updated') diff --git a/netbox/core/urls.py b/netbox/core/urls.py index 77c5724af..128020890 100644 --- a/netbox/core/urls.py +++ b/netbox/core/urls.py @@ -19,8 +19,4 @@ urlpatterns = ( path('data-files/delete/', views.DataFileBulkDeleteView.as_view(), name='datafile_bulk_delete'), path('data-files//', include(get_model_urls('core', 'datafile'))), - # Managed files - path('files/', views.ManagedFileListView.as_view(), name='managedfile_list'), - path('files//', include(get_model_urls('core', 'managedfile'))), - ) diff --git a/netbox/core/views.py b/netbox/core/views.py index 8f1cc905a..7a603ba1a 100644 --- a/netbox/core/views.py +++ b/netbox/core/views.py @@ -120,17 +120,3 @@ class DataFileBulkDeleteView(generic.BulkDeleteView): queryset = DataFile.objects.defer('data') filterset = filtersets.DataFileFilterSet table = tables.DataFileTable - - -# -# Managed files -# - -class ManagedFileListView(generic.ObjectListView): - queryset = ManagedFile.objects.all() - table = tables.ManagedFileTable - - -@register_model_view(ManagedFile) -class ManagedFileView(generic.ObjectView): - queryset = ManagedFile.objects.all() diff --git a/netbox/netbox/navigation/menu.py b/netbox/netbox/navigation/menu.py index 38037ca70..f5d15b3d8 100644 --- a/netbox/netbox/navigation/menu.py +++ b/netbox/netbox/navigation/menu.py @@ -313,7 +313,6 @@ OTHER_MENU = Menu( get_model_item('extras', 'tag', 'Tags'), get_model_item('extras', 'configcontext', _('Config Contexts'), actions=['add']), get_model_item('extras', 'configtemplate', _('Config Templates'), actions=['add']), - get_model_item('core', 'managedfile', _('Managed Files'), actions=()), ), ), ), diff --git a/netbox/templates/core/managedfile.html b/netbox/templates/core/managedfile.html deleted file mode 100644 index 5f9e5cc55..000000000 --- a/netbox/templates/core/managedfile.html +++ /dev/null @@ -1,57 +0,0 @@ -{% extends 'generic/object.html' %} -{% load buttons %} -{% load custom_links %} -{% load helpers %} -{% load perms %} -{% load plugins %} - -{% block controls %} -
-
- {% plugin_buttons object %} -
- {% if request.user|can_delete:object %} - {% delete_button object %} - {% endif %} -
- {% custom_links object %} -
-
-{% endblock controls %} - -{% block content %} -
-
-
-
Managed File
-
- - - - - - - - - - - - - -
Root{{ object.get_file_root_display }}
Path - {{ object.file_path }} - - - -
Last Updated{{ object.last_updated }}
-
-
- {% plugin_left_page object %} -
-
-
-
- {% plugin_full_width_page object %} -
-
-{% endblock %}