From d84200e4eb4d20116080130c612ba157a4718977 Mon Sep 17 00:00:00 2001 From: Matthias Kestenholz Date: Fri, 9 Aug 2024 17:18:42 +0200 Subject: Fixed #35648 -- Raised NotImplementedError in SafeString.__add__ for non-string RHS. This change ensures SafeString addition operations handle non-string RHS properly, allowing them to implement __radd__ for better compatibility. --- docs/releases/5.2.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/releases/5.2.txt b/docs/releases/5.2.txt index a15e669205..9b81117095 100644 --- a/docs/releases/5.2.txt +++ b/docs/releases/5.2.txt @@ -262,7 +262,10 @@ URLs Utilities ~~~~~~~~~ -* ... +* :class:`~django.utils.safestring.SafeString` now raises + :exc:`NotImplementedError` in ``__add__`` for non-string right-hand side + values. This aligns with the :py:class:`str` addition behavior and allows + ``__radd__`` to be used if available. Validators ~~~~~~~~~~ -- cgit v1.3