diff --git a/netbox_floorplan/models.py b/netbox_floorplan/models.py index c5ae279..5b7a523 100644 --- a/netbox_floorplan/models.py +++ b/netbox_floorplan/models.py @@ -56,7 +56,7 @@ def size(self): try: return self.file.size - except: + except NameError: return None @property diff --git a/netbox_floorplan/urls.py b/netbox_floorplan/urls.py index 49bb5c2..c4627a8 100644 --- a/netbox_floorplan/urls.py +++ b/netbox_floorplan/urls.py @@ -3,17 +3,45 @@ from netbox.views.generic import ObjectChangeLogView urlpatterns = ( - path('floorplans/', views.FloorplanListView.as_view(), name='floorplan_list'), - path('floorplans/racks/', views.FloorplanRackListView.as_view(), name='floorplan_rack_list'), - path('floorplans/devices/', views.FloorplanDeviceListView.as_view(), name='floorplan_device_list'), - path('floorplans/add/', views.FloorplanAddView.as_view(), name='floorplan_add'), - path('floorplans//edit/', views.FloorplanMapEditView.as_view(), name='floorplan_edit'), - path('floorplans//delete/', views.FloorplanDeleteView.as_view(), name='floorplan_delete'), - path('floorplans//changelog/', ObjectChangeLogView.as_view(), name='floorplan_changelog', kwargs={'model': models.Floorplan}), - path('floorplans/floorplanimages/', views.FloorplanImageListView.as_view(), name='floorplanimage_list'), - path('floorplans/floorplanimages/add/', views.FloorplanImageEditView.as_view(), name='floorplanimage_add'), - path('floorplans/floorplanimages//edit/', views.FloorplanImageEditView.as_view(), name='floorplanimage_edit'), - path('floorplans/floorplanimages//delete/', views.FloorplanImageDeleteView.as_view(), name='floorplanimage_delete'), - path('floorplans/floorplanimages//', views.FloorplanImageView.as_view(), name='floorplanimage'), - path('floorplans/floorplanimages//changelog/', ObjectChangeLogView.as_view(), name='floorplanimage_changelog', kwargs={'model': models.FloorplanImage}), + path('floorplans/', + views.FloorplanListView.as_view(), + name='floorplan_list'), + path('floorplans/racks/', + views.FloorplanRackListView.as_view(), + name='floorplan_rack_list'), + path('floorplans/devices/', + views.FloorplanDeviceListView.as_view(), + name='floorplan_device_list'), + path('floorplans/add/', + views.FloorplanAddView.as_view(), + name='floorplan_add'), + path('floorplans//edit/', + views.FloorplanMapEditView.as_view(), + name='floorplan_edit'), + path('floorplans//delete/', + views.FloorplanDeleteView.as_view(), + name='floorplan_delete'), + path('floorplans//changelog/', + ObjectChangeLogView.as_view(), + name='floorplan_changelog', + kwargs={'model': models.Floorplan}), + path('floorplans/floorplanimages/', + views.FloorplanImageListView.as_view(), + name='floorplanimage_list'), + path('floorplans/floorplanimages/add/', + views.FloorplanImageEditView.as_view(), + name='floorplanimage_add'), + path('floorplans/floorplanimages//edit/', + views.FloorplanImageEditView.as_view(), + name='floorplanimage_edit'), + path('floorplans/floorplanimages//delete/', + views.FloorplanImageDeleteView.as_view(), + name='floorplanimage_delete'), + path('floorplans/floorplanimages//', + views.FloorplanImageView.as_view(), + name='floorplanimage'), + path('floorplans/floorplanimages//changelog/', + ObjectChangeLogView.as_view(), + name='floorplanimage_changelog', + kwargs={'model': models.FloorplanImage}) )