Skip to content

Commit 89125da

Browse files
committed
lint fixes
1 parent ee577c3 commit 89125da

File tree

6 files changed

+16
-7
lines changed

6 files changed

+16
-7
lines changed

netbox_floorplan/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from netbox.plugins import PluginConfig
22
from .version import __version__
33

4+
45
class FloorplanConfig(PluginConfig):
56

67
name = "netbox_floorplan"

netbox_floorplan/api/serializers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
class FloorplanImageSerializer(NetBoxModelSerializer):
77
url = serializers.HyperlinkedIdentityField(
88
view_name='plugins-api:netbox_floorplan-api:floorplanimage-detail')
9-
9+
1010
class Meta:
1111
model = FloorplanImage
1212
fields = ['id', 'url', 'name', 'file', 'external_url', 'filename', 'comments', 'tags', 'custom_fields', 'created', 'last_updated']
1313
brief_fields = ['id', 'url', 'name', 'file', 'filename', 'external_url']
1414

15+
1516
class FloorplanSerializer(NetBoxModelSerializer):
1617
url = serializers.HyperlinkedIdentityField(
1718
view_name='plugins-api:netbox_floorplan-api:floorplan-detail')

netbox_floorplan/api/views.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class FloorplanViewSet(NetBoxModelViewSet):
99
serializer_class = FloorplanSerializer
1010
filterset_class = filtersets.FloorplanFilterSet
1111

12+
1213
class FloorplanImageViewSet(NetBoxModelViewSet):
1314
queryset = models.FloorplanImage.objects.prefetch_related('tags')
1415
serializer_class = FloorplanImageSerializer

netbox_floorplan/forms.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,25 @@
44
from utilities.forms.rendering import FieldSet
55
from utilities.forms.fields import CommentField
66

7+
78
class FloorplanImageForm(NetBoxModelForm):
9+
810
comments = CommentField()
911

1012
fieldsets = (
1113
FieldSet(('name', 'file', 'external_url', 'comments'), name='General'),
12-
FieldSet(('comments', 'tags'), name=''),
14+
FieldSet(('comments', 'tags'), name='')
1315
)
16+
1417
class Meta:
1518
model = FloorplanImage
1619
fields = [
1720
'name',
1821
'file',
1922
'external_url'
2023
]
24+
25+
2126
class FloorplanForm(NetBoxModelForm):
2227
class Meta:
2328
model = Floorplan

netbox_floorplan/models.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class FloorplanImage(NetBoxModel):
2121
upload_to=file_upload,
2222
blank=True
2323
)
24-
24+
2525
external_url = models.URLField(
2626
blank=True,
2727
max_length=255
@@ -36,7 +36,7 @@ def get_absolute_url(self):
3636

3737
def __str__(self):
3838
return f'{self.name}'
39-
39+
4040
class Meta:
4141
ordering = ('name',)
4242

@@ -109,15 +109,17 @@ class Floorplan(NetBoxModel):
109109
assigned_image = models.ForeignKey(
110110
to='FloorplanImage',
111111
blank=True,
112-
null=True,
112+
null=True,
113113
on_delete=models.SET_NULL
114114
)
115+
115116
width = models.DecimalField(
116117
max_digits=10,
117118
decimal_places=2,
118119
blank=True,
119120
null=True
120121
)
122+
121123
height = models.DecimalField(
122124
max_digits=10,
123125
decimal_places=2,
@@ -170,7 +172,6 @@ def mapped_racks(self):
170172
int(subobj["custom_meta"]["object_id"]))
171173
return drawn_racks
172174

173-
174175
@property
175176
def mapped_devices(self):
176177
drawn_devices = []

netbox_floorplan/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from netbox.views.generic import ObjectChangeLogView
44

55
urlpatterns = (
6-
path('floorplans/', views.FloorplanListView.as_view(),
6+
path('floorplans/', views.FloorplanListView.as_view(),
77
name='floorplan_list'),
88
path('floorplans/racks/', views.FloorplanRackListView.as_view(),
99
name='floorplan_rack_list'),

0 commit comments

Comments
 (0)