Skip to content

Commit 8d68b6a

Browse files
kkthxbye-codejeremystretch
authored andcommitted
Fixes #11694 - Remove obsolete SmallTextarea widget
1 parent c8faca0 commit 8d68b6a

File tree

10 files changed

+44
-53
lines changed

10 files changed

+44
-53
lines changed

netbox/circuits/forms/bulk_edit.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
from netbox.forms import NetBoxModelBulkEditForm
88
from tenancy.models import Tenant
99
from utilities.forms import (
10-
add_blank_choice, CommentField, DatePicker, DynamicModelChoiceField, DynamicModelMultipleChoiceField, SmallTextarea,
11-
StaticSelect,
10+
add_blank_choice, CommentField, DatePicker, DynamicModelChoiceField, DynamicModelMultipleChoiceField, StaticSelect,
1211
)
1312

1413
__all__ = (
@@ -35,7 +34,7 @@ class ProviderBulkEditForm(NetBoxModelBulkEditForm):
3534
required=False
3635
)
3736
comments = CommentField(
38-
widget=SmallTextarea,
37+
widget=forms.Textarea,
3938
label=_('Comments')
4039
)
4140

@@ -63,7 +62,7 @@ class ProviderNetworkBulkEditForm(NetBoxModelBulkEditForm):
6362
required=False
6463
)
6564
comments = CommentField(
66-
widget=SmallTextarea,
65+
widget=forms.Textarea,
6766
label=_('Comments')
6867
)
6968

@@ -125,7 +124,7 @@ class CircuitBulkEditForm(NetBoxModelBulkEditForm):
125124
required=False
126125
)
127126
comments = CommentField(
128-
widget=SmallTextarea,
127+
widget=forms.Textarea,
129128
label=_('Comments')
130129
)
131130

netbox/core/forms/bulk_edit.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from core.models import *
66
from netbox.forms import NetBoxModelBulkEditForm
77
from utilities.forms import (
8-
add_blank_choice, BulkEditNullBooleanSelect, CommentField, SmallTextarea, StaticSelect,
8+
add_blank_choice, BulkEditNullBooleanSelect, CommentField, StaticSelect,
99
)
1010

1111
__all__ = (
@@ -30,7 +30,7 @@ class DataSourceBulkEditForm(NetBoxModelBulkEditForm):
3030
required=False
3131
)
3232
comments = CommentField(
33-
widget=SmallTextarea,
33+
widget=forms.Textarea,
3434
label=_('Comments')
3535
)
3636
parameters = forms.JSONField(

netbox/dcim/forms/bulk_edit.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from tenancy.models import Tenant
1212
from utilities.forms import (
1313
add_blank_choice, BulkEditForm, BulkEditNullBooleanSelect, ColorField, CommentField, DynamicModelChoiceField,
14-
DynamicModelMultipleChoiceField, form_from_model, SmallTextarea, StaticSelect, SelectSpeedWidget,
14+
DynamicModelMultipleChoiceField, form_from_model, StaticSelect, SelectSpeedWidget,
1515
)
1616

1717
__all__ = (
@@ -138,7 +138,7 @@ class SiteBulkEditForm(NetBoxModelBulkEditForm):
138138
required=False
139139
)
140140
comments = CommentField(
141-
widget=SmallTextarea,
141+
widget=forms.Textarea,
142142
label='Comments'
143143
)
144144

@@ -309,7 +309,7 @@ class RackBulkEditForm(NetBoxModelBulkEditForm):
309309
required=False
310310
)
311311
comments = CommentField(
312-
widget=SmallTextarea,
312+
widget=forms.Textarea,
313313
label='Comments'
314314
)
315315

@@ -345,7 +345,7 @@ class RackReservationBulkEditForm(NetBoxModelBulkEditForm):
345345
required=False
346346
)
347347
comments = CommentField(
348-
widget=SmallTextarea,
348+
widget=forms.Textarea,
349349
label='Comments'
350350
)
351351

@@ -406,7 +406,7 @@ class DeviceTypeBulkEditForm(NetBoxModelBulkEditForm):
406406
required=False
407407
)
408408
comments = CommentField(
409-
widget=SmallTextarea,
409+
widget=forms.Textarea,
410410
label='Comments'
411411
)
412412

@@ -441,7 +441,7 @@ class ModuleTypeBulkEditForm(NetBoxModelBulkEditForm):
441441
required=False
442442
)
443443
comments = CommentField(
444-
widget=SmallTextarea,
444+
widget=forms.Textarea,
445445
label='Comments'
446446
)
447447

@@ -551,7 +551,7 @@ class DeviceBulkEditForm(NetBoxModelBulkEditForm):
551551
required=False
552552
)
553553
comments = CommentField(
554-
widget=SmallTextarea,
554+
widget=forms.Textarea,
555555
label='Comments'
556556
)
557557

@@ -594,7 +594,7 @@ class ModuleBulkEditForm(NetBoxModelBulkEditForm):
594594
required=False
595595
)
596596
comments = CommentField(
597-
widget=SmallTextarea,
597+
widget=forms.Textarea,
598598
label='Comments'
599599
)
600600

@@ -644,7 +644,7 @@ class CableBulkEditForm(NetBoxModelBulkEditForm):
644644
required=False
645645
)
646646
comments = CommentField(
647-
widget=SmallTextarea,
647+
widget=forms.Textarea,
648648
label='Comments'
649649
)
650650

@@ -668,7 +668,7 @@ class VirtualChassisBulkEditForm(NetBoxModelBulkEditForm):
668668
required=False
669669
)
670670
comments = CommentField(
671-
widget=SmallTextarea,
671+
widget=forms.Textarea,
672672
label='Comments'
673673
)
674674

@@ -714,7 +714,7 @@ class PowerPanelBulkEditForm(NetBoxModelBulkEditForm):
714714
required=False
715715
)
716716
comments = CommentField(
717-
widget=SmallTextarea,
717+
widget=forms.Textarea,
718718
label='Comments'
719719
)
720720

@@ -776,7 +776,7 @@ class PowerFeedBulkEditForm(NetBoxModelBulkEditForm):
776776
required=False
777777
)
778778
comments = CommentField(
779-
widget=SmallTextarea,
779+
widget=forms.Textarea,
780780
label=_('Comments')
781781
)
782782

netbox/dcim/forms/model_forms.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from tenancy.forms import TenancyForm
1313
from utilities.forms import (
1414
APISelect, add_blank_choice, BootstrapMixin, ClearableFileInput, CommentField, ContentTypeChoiceField,
15-
DynamicModelChoiceField, DynamicModelMultipleChoiceField, JSONField, NumericArrayField, SelectWithPK, SmallTextarea,
15+
DynamicModelChoiceField, DynamicModelMultipleChoiceField, JSONField, NumericArrayField, SelectWithPK,
1616
SlugField, StaticSelect, SelectSpeedWidget,
1717
)
1818
from virtualization.models import Cluster, ClusterGroup
@@ -149,12 +149,12 @@ class Meta:
149149
'description', 'physical_address', 'shipping_address', 'latitude', 'longitude', 'comments', 'tags',
150150
)
151151
widgets = {
152-
'physical_address': SmallTextarea(
152+
'physical_address': forms.Textarea(
153153
attrs={
154154
'rows': 3,
155155
}
156156
),
157-
'shipping_address': SmallTextarea(
157+
'shipping_address': forms.Textarea(
158158
attrs={
159159
'rows': 3,
160160
}
@@ -470,7 +470,7 @@ class Meta:
470470
'name', 'slug', 'manufacturer', 'napalm_driver', 'napalm_args', 'description', 'tags',
471471
]
472472
widgets = {
473-
'napalm_args': SmallTextarea(),
473+
'napalm_args': forms.Textarea(),
474474
}
475475

476476

netbox/ipam/forms/bulk_edit.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from tenancy.models import Tenant
1111
from utilities.forms import (
1212
add_blank_choice, BulkEditNullBooleanSelect, CommentField, DynamicModelChoiceField, NumericArrayField,
13-
SmallTextarea, StaticSelect, DynamicModelMultipleChoiceField,
13+
StaticSelect, DynamicModelMultipleChoiceField,
1414
)
1515

1616
__all__ = (
@@ -48,7 +48,7 @@ class VRFBulkEditForm(NetBoxModelBulkEditForm):
4848
required=False
4949
)
5050
comments = CommentField(
51-
widget=SmallTextarea,
51+
widget=forms.Textarea,
5252
label='Comments'
5353
)
5454

@@ -69,7 +69,7 @@ class RouteTargetBulkEditForm(NetBoxModelBulkEditForm):
6969
required=False
7070
)
7171
comments = CommentField(
72-
widget=SmallTextarea,
72+
widget=forms.Textarea,
7373
label='Comments'
7474
)
7575

@@ -116,7 +116,7 @@ class ASNBulkEditForm(NetBoxModelBulkEditForm):
116116
required=False
117117
)
118118
comments = CommentField(
119-
widget=SmallTextarea,
119+
widget=forms.Textarea,
120120
label='Comments'
121121
)
122122

@@ -145,7 +145,7 @@ class AggregateBulkEditForm(NetBoxModelBulkEditForm):
145145
required=False
146146
)
147147
comments = CommentField(
148-
widget=SmallTextarea,
148+
widget=forms.Textarea,
149149
label='Comments'
150150
)
151151

@@ -227,7 +227,7 @@ class PrefixBulkEditForm(NetBoxModelBulkEditForm):
227227
required=False
228228
)
229229
comments = CommentField(
230-
widget=SmallTextarea,
230+
widget=forms.Textarea,
231231
label='Comments'
232232
)
233233

@@ -266,7 +266,7 @@ class IPRangeBulkEditForm(NetBoxModelBulkEditForm):
266266
required=False
267267
)
268268
comments = CommentField(
269-
widget=SmallTextarea,
269+
widget=forms.Textarea,
270270
label='Comments'
271271
)
272272

@@ -314,7 +314,7 @@ class IPAddressBulkEditForm(NetBoxModelBulkEditForm):
314314
required=False
315315
)
316316
comments = CommentField(
317-
widget=SmallTextarea,
317+
widget=forms.Textarea,
318318
label='Comments'
319319
)
320320

@@ -359,7 +359,7 @@ class FHRPGroupBulkEditForm(NetBoxModelBulkEditForm):
359359
required=False
360360
)
361361
comments = CommentField(
362-
widget=SmallTextarea,
362+
widget=forms.Textarea,
363363
label='Comments'
364364
)
365365

@@ -442,7 +442,7 @@ class VLANBulkEditForm(NetBoxModelBulkEditForm):
442442
required=False
443443
)
444444
comments = CommentField(
445-
widget=SmallTextarea,
445+
widget=forms.Textarea,
446446
label='Comments'
447447
)
448448

@@ -474,7 +474,7 @@ class ServiceTemplateBulkEditForm(NetBoxModelBulkEditForm):
474474
required=False
475475
)
476476
comments = CommentField(
477-
widget=SmallTextarea,
477+
widget=forms.Textarea,
478478
label='Comments'
479479
)
480480

@@ -504,7 +504,7 @@ class L2VPNBulkEditForm(NetBoxModelBulkEditForm):
504504
required=False
505505
)
506506
comments = CommentField(
507-
widget=SmallTextarea,
507+
widget=forms.Textarea,
508508
label='Comments'
509509
)
510510

netbox/tenancy/forms/bulk_edit.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from netbox.forms import NetBoxModelBulkEditForm
44
from tenancy.models import *
5-
from utilities.forms import CommentField, DynamicModelChoiceField, SmallTextarea
5+
from utilities.forms import CommentField, DynamicModelChoiceField
66

77
__all__ = (
88
'ContactBulkEditForm',
@@ -106,7 +106,7 @@ class ContactBulkEditForm(NetBoxModelBulkEditForm):
106106
required=False
107107
)
108108
comments = CommentField(
109-
widget=SmallTextarea,
109+
widget=forms.Textarea,
110110
label='Comments'
111111
)
112112

netbox/tenancy/forms/model_forms.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from netbox.forms import NetBoxModelForm
44
from tenancy.models import *
55
from utilities.forms import (
6-
BootstrapMixin, CommentField, DynamicModelChoiceField, SlugField, SmallTextarea, StaticSelect,
6+
BootstrapMixin, CommentField, DynamicModelChoiceField, SlugField, StaticSelect,
77
)
88

99
__all__ = (
@@ -112,7 +112,7 @@ class Meta:
112112
'group', 'name', 'title', 'phone', 'email', 'address', 'link', 'description', 'comments', 'tags',
113113
)
114114
widgets = {
115-
'address': SmallTextarea(attrs={'rows': 3}),
115+
'address': forms.Textarea(attrs={'rows': 3}),
116116
}
117117

118118

netbox/utilities/forms/widgets.py

-8
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
'SelectSpeedWidget',
2222
'SelectWithPK',
2323
'SlugWidget',
24-
'SmallTextarea',
2524
'StaticSelect',
2625
'StaticSelectMultiple',
2726
'TimePicker',
@@ -33,13 +32,6 @@
3332
ProcessedParams = Sequence[Dict[str, Sequence[JSONPrimitive]]]
3433

3534

36-
class SmallTextarea(forms.Textarea):
37-
"""
38-
Subclass used for rendering a smaller textarea element.
39-
"""
40-
pass
41-
42-
4335
class SlugWidget(forms.TextInput):
4436
"""
4537
Subclass TextInput and add a slug regeneration button next to the form field.

netbox/virtualization/forms/bulk_edit.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from tenancy.models import Tenant
1010
from utilities.forms import (
1111
add_blank_choice, BulkEditNullBooleanSelect, BulkRenameForm, CommentField, DynamicModelChoiceField,
12-
DynamicModelMultipleChoiceField, SmallTextarea, StaticSelect
12+
DynamicModelMultipleChoiceField, StaticSelect
1313
)
1414
from virtualization.choices import *
1515
from virtualization.models import *
@@ -90,7 +90,7 @@ class ClusterBulkEditForm(NetBoxModelBulkEditForm):
9090
required=False
9191
)
9292
comments = CommentField(
93-
widget=SmallTextarea,
93+
widget=forms.Textarea,
9494
label=_('Comments')
9595
)
9696

@@ -163,7 +163,7 @@ class VirtualMachineBulkEditForm(NetBoxModelBulkEditForm):
163163
required=False
164164
)
165165
comments = CommentField(
166-
widget=SmallTextarea,
166+
widget=forms.Textarea,
167167
label=_('Comments')
168168
)
169169

0 commit comments

Comments
 (0)