diff options
| author | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2024-12-12 17:39:58 +0100 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2025-01-15 22:28:37 +0100 |
| commit | 9a3f86e96009c1137b286f6d579b9d812a0dee69 (patch) | |
| tree | 65c8a7d094e5db90a0a2ffe62f36f5ecfce211fb /django/forms | |
| parent | 9cb1ffa67bb0d13f86c2d4627428fcaa4513136d (diff) | |
Refs #34380 -- Changed the URLField default scheme to https and removed FORMS_URLFIELD_ASSUME_HTTPS per deprecation timeline.
Diffstat (limited to 'django/forms')
| -rw-r--r-- | django/forms/fields.py | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/django/forms/fields.py b/django/forms/fields.py index 4bd9c352f2..04aa2039fd 100644 --- a/django/forms/fields.py +++ b/django/forms/fields.py @@ -10,12 +10,10 @@ import operator import os import re import uuid -import warnings from decimal import Decimal, DecimalException from io import BytesIO from urllib.parse import urlsplit, urlunsplit -from django.conf import settings from django.core import validators from django.core.exceptions import ValidationError from django.forms.boundfield import BoundField @@ -44,7 +42,6 @@ from django.forms.widgets import ( from django.utils import formats from django.utils.choices import normalize_choices from django.utils.dateparse import parse_datetime, parse_duration -from django.utils.deprecation import RemovedInDjango60Warning from django.utils.duration import duration_string from django.utils.ipv6 import MAX_IPV6_ADDRESS_LENGTH, clean_ipv6_address from django.utils.regex_helper import _lazy_re_compile @@ -777,23 +774,7 @@ class URLField(CharField): default_validators = [validators.URLValidator()] def __init__(self, *, assume_scheme=None, **kwargs): - if assume_scheme is None: - if settings.FORMS_URLFIELD_ASSUME_HTTPS: - assume_scheme = "https" - else: - warnings.warn( - "The default scheme will be changed from 'http' to 'https' in " - "Django 6.0. Pass the forms.URLField.assume_scheme argument to " - "silence this warning, or set the FORMS_URLFIELD_ASSUME_HTTPS " - "transitional setting to True to opt into using 'https' as the new " - "default scheme.", - RemovedInDjango60Warning, - stacklevel=2, - ) - assume_scheme = "http" - # RemovedInDjango60Warning: When the deprecation ends, replace with: - # self.assume_scheme = assume_scheme or "https" - self.assume_scheme = assume_scheme + self.assume_scheme = assume_scheme or "https" super().__init__(strip=True, **kwargs) def to_python(self, value): |
