diff --git a/netbox/circuits/forms/model_forms.py b/netbox/circuits/forms/model_forms.py
index 6a2099f83..8a540032e 100644
--- a/netbox/circuits/forms/model_forms.py
+++ b/netbox/circuits/forms/model_forms.py
@@ -26,9 +26,7 @@ class ProviderForm(NetBoxModelForm):
label=_('ASNs'),
required=False
)
- comments = CommentField(
- label=_('Comments'),
- )
+ comments = CommentField()
fieldsets = (
(_('Provider'), ('name', 'slug', 'asns', 'description', 'tags')),
@@ -46,9 +44,7 @@ class ProviderAccountForm(NetBoxModelForm):
label=_('Provider'),
queryset=Provider.objects.all()
)
- comments = CommentField(
- label=_('Comments'),
- )
+ comments = CommentField()
class Meta:
model = ProviderAccount
@@ -62,9 +58,7 @@ class ProviderNetworkForm(NetBoxModelForm):
label=_('Provider'),
queryset=Provider.objects.all()
)
- comments = CommentField(
- label=_('Comments'),
- )
+ comments = CommentField()
fieldsets = (
(_('Provider Network'), ('provider', 'name', 'service_id', 'description', 'tags')),
diff --git a/netbox/core/forms/model_forms.py b/netbox/core/forms/model_forms.py
index 6f89bee09..01d5474c6 100644
--- a/netbox/core/forms/model_forms.py
+++ b/netbox/core/forms/model_forms.py
@@ -18,9 +18,7 @@ __all__ = (
class DataSourceForm(NetBoxModelForm):
- comments = CommentField(
- label=_('Comments'),
- )
+ comments = CommentField()
class Meta:
model = DataSource
diff --git a/netbox/dcim/forms/model_forms.py b/netbox/dcim/forms/model_forms.py
index 68292d90a..c791181e9 100644
--- a/netbox/dcim/forms/model_forms.py
+++ b/netbox/dcim/forms/model_forms.py
@@ -132,9 +132,7 @@ class SiteForm(TenancyForm, NetBoxModelForm):
choices=add_blank_choice(TimeZoneFormField().choices),
required=False
)
- comments = CommentField(
- label=_('Comments'),
- )
+ comments = CommentField()
fieldsets = (
(_('Site'), (
@@ -227,9 +225,7 @@ class RackForm(TenancyForm, NetBoxModelForm):
queryset=RackRole.objects.all(),
required=False
)
- comments = CommentField(
- label=_('Comments'),
- )
+ comments = CommentField()
class Meta:
model = Rack
@@ -301,9 +297,7 @@ class DeviceTypeForm(NetBoxModelForm):
label=_('Slug'),
slug_source='model'
)
- comments = CommentField(
- label=_('Comments'),
- )
+ comments = CommentField()
fieldsets = (
(_('Device Type'), ('manufacturer', 'model', 'slug', 'default_platform', 'description', 'tags')),
@@ -335,9 +329,7 @@ class ModuleTypeForm(NetBoxModelForm):
label=_('Manufacturer'),
queryset=Manufacturer.objects.all()
)
- comments = CommentField(
- label=_('Comments'),
- )
+ comments = CommentField()
fieldsets = (
(_('Module Type'), ('manufacturer', 'model', 'part_number', 'description', 'tags')),
@@ -457,9 +449,7 @@ class DeviceForm(TenancyForm, NetBoxModelForm):
required=False,
selector=True
)
- comments = CommentField(
- label=_('Comments'),
- )
+ comments = CommentField()
local_context_data = JSONField(
required=False,
label=''
@@ -577,9 +567,7 @@ class ModuleForm(ModuleCommonForm, NetBoxModelForm):
queryset=ModuleType.objects.all(),
selector=True
)
- comments = CommentField(
- label=_('Comments'),
- )
+ comments = CommentField()
replicate_components = forms.BooleanField(
label=_('Replicate components'),
required=False,
@@ -619,9 +607,7 @@ class ModuleForm(ModuleCommonForm, NetBoxModelForm):
class CableForm(TenancyForm, NetBoxModelForm):
- comments = CommentField(
- label=_('Comments'),
- )
+ comments = CommentField()
class Meta:
model = Cable
@@ -675,9 +661,7 @@ class PowerFeedForm(TenancyForm, NetBoxModelForm):
required=False,
selector=True
)
- comments = CommentField(
- label=_('Comments'),
- )
+ comments = CommentField()
fieldsets = (
(_('Power Feed'), ('power_panel', 'rack', 'name', 'status', 'type', 'description', 'mark_connected', 'tags')),
@@ -703,9 +687,7 @@ class VirtualChassisForm(NetBoxModelForm):
queryset=Device.objects.all(),
required=False,
)
- comments = CommentField(
- label=_('Comments'),
- )
+ comments = CommentField()
class Meta:
model = VirtualChassis
diff --git a/netbox/extras/forms/model_forms.py b/netbox/extras/forms/model_forms.py
index a968ec523..414563f59 100644
--- a/netbox/extras/forms/model_forms.py
+++ b/netbox/extras/forms/model_forms.py
@@ -438,9 +438,7 @@ class JournalEntryForm(NetBoxModelForm):
choices=add_blank_choice(JournalEntryKindChoices),
required=False
)
- comments = CommentField(
- label=_('Comments'),
- )
+ comments = CommentField()
class Meta:
model = JournalEntry
diff --git a/netbox/ipam/forms/model_forms.py b/netbox/ipam/forms/model_forms.py
index 29aeb28cd..730abf4e6 100644
--- a/netbox/ipam/forms/model_forms.py
+++ b/netbox/ipam/forms/model_forms.py
@@ -55,9 +55,7 @@ class VRFForm(TenancyForm, NetBoxModelForm):
queryset=RouteTarget.objects.all(),
required=False
)
- comments = CommentField(
- label=_('Comments'),
- )
+ comments = CommentField()
fieldsets = (
(_('VRF'), ('name', 'rd', 'enforce_unique', 'description', 'tags')),
@@ -81,9 +79,7 @@ class RouteTargetForm(TenancyForm, NetBoxModelForm):
('Route Target', ('name', 'description', 'tags')),
('Tenancy', ('tenant_group', 'tenant')),
)
- comments = CommentField(
- label=_('Comments'),
- )
+ comments = CommentField()
class Meta:
model = RouteTarget
@@ -113,9 +109,7 @@ class AggregateForm(TenancyForm, NetBoxModelForm):
queryset=RIR.objects.all(),
label=_('RIR')
)
- comments = CommentField(
- label=_('Comments'),
- )
+ comments = CommentField()
fieldsets = (
(_('Aggregate'), ('prefix', 'rir', 'date_added', 'description', 'tags')),
@@ -160,9 +154,7 @@ class ASNForm(TenancyForm, NetBoxModelForm):
label=_('Sites'),
required=False
)
- comments = CommentField(
- label=_('Comments'),
- )
+ comments = CommentField()
fieldsets = (
(_('ASN'), ('asn', 'rir', 'sites', 'description', 'tags')),
@@ -230,9 +222,7 @@ class PrefixForm(TenancyForm, NetBoxModelForm):
queryset=Role.objects.all(),
required=False
)
- comments = CommentField(
- label=_('Comments'),
- )
+ comments = CommentField()
fieldsets = (
(_('Prefix'), ('prefix', 'status', 'vrf', 'role', 'is_pool', 'mark_utilized', 'description', 'tags')),
@@ -259,9 +249,7 @@ class IPRangeForm(TenancyForm, NetBoxModelForm):
queryset=Role.objects.all(),
required=False
)
- comments = CommentField(
- label=_('Comments'),
- )
+ comments = CommentField()
fieldsets = (
(_('IP Range'), ('vrf', 'start_address', 'end_address', 'role', 'status', 'mark_utilized', 'description', 'tags')),
@@ -676,9 +664,7 @@ class ServiceTemplateForm(NetBoxModelForm):
),
help_text=_("Comma-separated list of one or more port numbers. A range may be specified using a hyphen.")
)
- comments = CommentField(
- label=_('Comments'),
- )
+ comments = CommentField()
fieldsets = (
(_('Service Template'), (
@@ -782,9 +768,7 @@ class L2VPNForm(TenancyForm, NetBoxModelForm):
queryset=RouteTarget.objects.all(),
required=False
)
- comments = CommentField(
- label=_('Comments'),
- )
+ comments = CommentField()
fieldsets = (
(_('L2VPN'), ('name', 'slug', 'type', 'identifier', 'description', 'tags')),
diff --git a/netbox/tenancy/forms/model_forms.py b/netbox/tenancy/forms/model_forms.py
index 8eb8de883..41a202c7f 100644
--- a/netbox/tenancy/forms/model_forms.py
+++ b/netbox/tenancy/forms/model_forms.py
@@ -48,9 +48,7 @@ class TenantForm(NetBoxModelForm):
queryset=TenantGroup.objects.all(),
required=False
)
- comments = CommentField(
- label=_('Comments'),
- )
+ comments = CommentField()
fieldsets = (
(_('Tenant'), ('name', 'slug', 'group', 'description', 'tags')),
@@ -106,9 +104,7 @@ class ContactForm(NetBoxModelForm):
queryset=ContactGroup.objects.all(),
required=False
)
- comments = CommentField(
- label=_('Comments'),
- )
+ comments = CommentField()
fieldsets = (
(_('Contact'), ('group', 'name', 'title', 'phone', 'email', 'address', 'link', 'description', 'tags')),
diff --git a/netbox/utilities/forms/fields/fields.py b/netbox/utilities/forms/fields/fields.py
index 9ed12f84a..db5e4a30d 100644
--- a/netbox/utilities/forms/fields/fields.py
+++ b/netbox/utilities/forms/fields/fields.py
@@ -26,14 +26,14 @@ class CommentField(forms.CharField):
A textarea with support for Markdown rendering. Exists mostly just to add a standard `help_text`.
"""
widget = widgets.MarkdownWidget
- help_text = _("""
-
-
- Markdown syntax is supported
- """).format(url=static('docs/reference/markdown/'))
+ label = _('Comments')
+ help_text = _(
+ ' '
+ 'Markdown syntax is supported'
+ ).format(url=static('docs/reference/markdown/'))
- def __init__(self, *, help_text=help_text, required=False, **kwargs):
- super().__init__(help_text=help_text, required=required, **kwargs)
+ def __init__(self, *, label=label, help_text=help_text, required=False, **kwargs):
+ super().__init__(label=label, help_text=help_text, required=required, **kwargs)
class SlugField(forms.SlugField):
diff --git a/netbox/virtualization/forms/model_forms.py b/netbox/virtualization/forms/model_forms.py
index 266ef76b2..a082162b0 100644
--- a/netbox/virtualization/forms/model_forms.py
+++ b/netbox/virtualization/forms/model_forms.py
@@ -74,9 +74,7 @@ class ClusterForm(TenancyForm, NetBoxModelForm):
required=False,
selector=True
)
- comments = CommentField(
- label=_('Comments'),
- )
+ comments = CommentField()
fieldsets = (
(_('Cluster'), ('name', 'type', 'group', 'site', 'status', 'description', 'tags')),
diff --git a/netbox/wireless/forms/model_forms.py b/netbox/wireless/forms/model_forms.py
index 1f8064f25..666bddaa9 100644
--- a/netbox/wireless/forms/model_forms.py
+++ b/netbox/wireless/forms/model_forms.py
@@ -48,9 +48,7 @@ class WirelessLANForm(TenancyForm, NetBoxModelForm):
selector=True,
label=_('VLAN')
)
- comments = CommentField(
- label=_('Comments'),
- )
+ comments = CommentField()
fieldsets = (
(_('Wireless LAN'), ('ssid', 'group', 'vlan', 'status', 'description', 'tags')),