summaryrefslogtreecommitdiff
path: root/django/utils
AgeCommit message (Collapse)Author
2022-06-20[4.1.x] Fixed #23689 -- Made parsing HTTP Accept-Language header ↵Zainab Amir
case-insensitive. Thank you Daniel Samuels for test project. Backport of 901a1691982cab76349d33e51b72c40120ec927a from main
2022-05-31[4.1.x] Fixed #33748 -- Fixed date template filter crash with lazy format.Claude Paroz
Regression in 659d2421c7adbbcd205604002d521d82d6b0b465. Backport of 292f372768836e2aebc713064c5139e8067eebcb from main
2022-05-12Made closing in connection handlers more DRY.Nick Pope
2022-05-11Refs #33173 -- Removed use of deprecated cgi module.Carlton Gibson
https://peps.python.org/pep-0594/#cgi
2022-04-20Fixed #33654 -- Added localdate to utils.timezone.__all__. Andrey Otto
2022-03-29Refs #32365 -- Deprecated django.utils.timezone.utc.Carlton Gibson
2022-03-24Refs #32365 -- Removed internal uses of utils.timezone.utc alias.Carlton Gibson
Remaining test case ensures that uses of the alias are mapped canonically by the migration writer.
2022-03-17Prevented initialization of unused database connections.Florian Apolloner
2022-03-15Fixed #31169 -- Adapted the parallel test runner to use spawn.David Smith
Co-authored-by: Valz <ahmadahussein0@gmail.com> Co-authored-by: Nick Pope <nick@nickpope.me.uk>
2022-03-08Refs #33173 -- Used locale.getlocale() instead of getdefaultlocale().Mariusz Felisiak
locale.getdefaultlocale() was deprecated in Python 3.11, see https://bugs.python.org/issue46659.
2022-03-03Optimized lazy wrappers a bit.Collin Anderson
This avoids an extra __getattribute__() call for self._wrapped.
2022-02-23Fixed #33532 -- Optimized CaseInsensitiveMapping instantiation for dicts.Keryn Knight
Internal usages of this class (e.g. HttpHeaders) provide it with a dict, so testing for that type first avoids the cost of going through the potential __instancecheck__ + _abc_instancecheck to establish it's a Mapping. Co-authored-by: Nick Pope <nick@nickpope.me.uk>
2022-02-22Refs #32873 -- Avoided looking up settings._USE_L10N_INTERNAL twice.Collin Anderson
2022-02-21Fixed #20296 -- Prevented mark_safe() from evaluating lazy objects.Theo Alexiou
2022-02-21Removed unnecessary str type from @keep_lazy decorator for escape()/escapejs().Mariusz Felisiak
2022-02-21Fixed #33518 -- Added RemovedAfterNextVersionWarning.saeedblanchette
2022-02-19Refs #33173 -- Fixed MailTests.test_backend_arg() on Windows and Python 3.11+.David Smith
2022-02-17Refs #28358 -- Fixed infinite recursion in LazyObject.__getattribute__().Matthias Kestenholz
Regression in 97d7990abde3fe4b525ae83958fd0b52d6a1d13f. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com> Co-authored-by: Theo Alexiou <theofilosalexiou@gmail.com>
2022-02-16Fixed #28358 -- Prevented LazyObject from mimicking nonexistent attributes.Theo Alexiou
Thanks Sergey Fedoseev for the initial patch.
2022-02-10Fixed #26287 -- Added support for addition operations to SimpleLazyObject.Theo Alexiou
2022-02-10Refs #32568 -- Optimized escape() by using SafeString instead of mark_safe().David
2022-02-07Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2022-01-29Fixed #33465 -- Added empty __slots__ to SafeString and SafeData.Keryn Knight
Despite inheriting from the str type, every SafeString instance gains an empty __dict__ due to the normal, expected behaviour of type subclassing in Python. Adding __slots__ to SafeData is necessary, because otherwise inheriting from that (as SafeString does) will give it a __dict__ and negate the benefit added by modifying SafeString.
2022-01-12Changed django.utils.log.log_response() to take exception instance.Adam Johnson
There's little point retrieving a fresh reference to the exception in the legacy tuple format, when it's all available via the exception instance we already have.
2022-01-11Refs #30141 -- Removed unused branch in parse_duration().Mariusz Felisiak
Unused since 99fc5dc13c12d874ffc1c8f47a6421494e720b31.
2022-01-07Refs #32355 -- Removed unnecessary list() calls before reversed() on dictviews.Mariusz Felisiak
Dict and dictviews are iterable in reversed insertion order using reversed() in Python 3.8+.
2022-01-07Fixed #28628 -- Changed \d to [0-9] in regexes where appropriate.Ad Timmering
2022-01-04Refs #33216 -- Made @deconstructible do not change path for subclasses.Allen Jonathan David
2021-12-30Refs #27753 -- Removed unused django.utils.text._replace_entity() and ↵Mariusz Felisiak
_entity_re. Unused since 157ab32f3446da7fa1f9d716509c290069a2a156.
2021-12-21Optimized MiddlewareMixin coroutine check.Adam Johnson
2021-12-20Fixed #33368 -- Fixed parse_duration() crash on invalid separators for ↵mendespedro
decimal fractions.
2021-12-17Changed signatures of setting_changed signal receivers.Adam Johnson
2021-12-16Fixed #30127 -- Deprecated name argument of cached_property().mgaligniana
2021-12-14Fixed unescape_string_literal() crash on empty strings.Florian Apolloner
2021-12-03Fixed #33078 -- Added support for language regions in i18n_patterns().Maxim Piskunov
2021-12-02Updated various links to HTTPS and new locations.Mariusz Felisiak
Co-Authored-By: Nick Pope <nick@nickpope.me.uk>
2021-11-22Fixed #33302 -- Made element_id optional argument for json_script template ↵Baptiste Mispelon
filter. Added versionchanged note in documentation
2021-11-03Refs #33245 -- Minor edits to django.utils.html.urlize() changes.tim-mccurrach
Follow up to ad81b606a2b5276397460a654fc7ad901a54b91e.
2021-11-01Fixed #33245 -- Made django.utils.html.urlize() thread-safe.Timothy McCurrach
Regression in e567670b1abe61af4acfaa6a6a7e92a7acfa8b00.
2021-10-20Fixed #33043 -- Made method_decorator() preserve wrapper assignments.Vinay Karanam
Regression in f434f5b84f7fcea9a76a551621ecce70786e2899.
2021-10-15Fixed #33195 -- Refactored urlize() based on a class.Claude Paroz
This allows easier customization/
2021-10-14Removed unused DOTS list.Claude Paroz
Unused since 4ff389dcdc15884eef059b2b8dea4b710e0a3b98.
2021-10-12Fixed #28401 -- Allowed hashlib.md5() calls to work with FIPS kernels.Ade Lee
md5 is not an approved algorithm in FIPS mode, and trying to instantiate a hashlib.md5() will fail when the system is running in FIPS mode. md5 is allowed when in a non-security context. There is a plan to add a keyword parameter (usedforsecurity) to hashlib.md5() to annotate whether or not the instance is being used in a security context. In the case where it is not, the instantiation of md5 will be allowed. See https://bugs.python.org/issue9216 for more details. Some downstream python versions already support this parameter. To support these versions, a new encapsulation of md5() has been added. This encapsulation will pass through the usedforsecurity parameter in the case where the parameter is supported, and strip it if it is not. Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-10-04Refs #33107 -- Optimized cached_import() helper.Nick Pope
2021-09-30Optimized @async_unsafe.Adam Johnson
Switched the order of the checks to reduce the overhead. Async unsafe methods are *normally* called syncrhonously, so we can avoid the overhead of checking the environment variable in the regular path.
2021-09-29Fixed #33027 -- Made autoreloader pass -X options.Chenyang Yan
2021-09-27Refs #32355 -- Used @functools.lru_cache as a straight decorator.Mariusz Felisiak
2021-09-27Refs #32355 -- Modernized subprocess.run() calls.Adam Johnson
2021-09-22Optimized handling case-insensitive mappings.Illia Volochii
Elements yielded by _destruct_iterable_mapping_values are always unpacked. Since unpacking can be done with any iterable, there is no need to convert elements to tuples. Also, such elements can be used directly in for loops, creating a dictionary of them is excessive. Co-authored-by: Nick Pope <nick@nickpope.me.uk>