From 577f2338f16bea055abc49c5a43fa3ecb05dffc8 Mon Sep 17 00:00:00 2001 From: Hasan Ramezani Date: Sat, 19 Dec 2020 20:53:30 +0100 Subject: Fixed #32208 -- Allowed adding lazy() objects. Co-authored-by: Claude Paroz --- django/utils/functional.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'django') diff --git a/django/utils/functional.py b/django/utils/functional.py index 6d38f932f9..5c8a0c233f 100644 --- a/django/utils/functional.py +++ b/django/utils/functional.py @@ -176,6 +176,12 @@ def lazy(func, *resultclasses): return str(self) % rhs return self.__cast() % rhs + def __add__(self, other): + return self.__cast() + other + + def __radd__(self, other): + return other + self.__cast() + def __deepcopy__(self, memo): # Instances of this class are effectively immutable. It's just a # collection of functions. So we don't need to do anything -- cgit v1.3