From 3a6d4ce0cb4e10835be95065156eeb096370b27d Mon Sep 17 00:00:00 2001 From: Jeremy Stretch Date: Mon, 10 Mar 2025 14:55:31 -0400 Subject: [PATCH] Pass assume_scheme on URLFields to avoid RemovedInDjango60Warning --- netbox/extras/dashboard/widgets.py | 3 ++- netbox/extras/models/customfields.py | 2 +- netbox/tenancy/forms/bulk_edit.py | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/netbox/extras/dashboard/widgets.py b/netbox/extras/dashboard/widgets.py index eeed5414f..4338f74d6 100644 --- a/netbox/extras/dashboard/widgets.py +++ b/netbox/extras/dashboard/widgets.py @@ -284,7 +284,8 @@ class RSSFeedWidget(DashboardWidget): class ConfigForm(WidgetConfigForm): feed_url = forms.URLField( - label=_('Feed URL') + label=_('Feed URL'), + assume_scheme='https' ) requires_internet = forms.BooleanField( label=_('Requires external connection'), diff --git a/netbox/extras/models/customfields.py b/netbox/extras/models/customfields.py index e1ceaf7a6..79b01b6ab 100644 --- a/netbox/extras/models/customfields.py +++ b/netbox/extras/models/customfields.py @@ -515,7 +515,7 @@ class CustomField(CloningMixin, ExportTemplatesMixin, ChangeLoggedModel): # URL elif self.type == CustomFieldTypeChoices.TYPE_URL: - field = LaxURLField(required=required, initial=initial) + field = LaxURLField(assume_scheme='https', required=required, initial=initial) # JSON elif self.type == CustomFieldTypeChoices.TYPE_JSON: diff --git a/netbox/tenancy/forms/bulk_edit.py b/netbox/tenancy/forms/bulk_edit.py index 5af3f22ac..d3a63fdcd 100644 --- a/netbox/tenancy/forms/bulk_edit.py +++ b/netbox/tenancy/forms/bulk_edit.py @@ -116,6 +116,7 @@ class ContactBulkEditForm(NetBoxModelBulkEditForm): ) link = forms.URLField( label=_('Link'), + assume_scheme='https', required=False ) description = forms.CharField(