From a2f8a4a6f9ac094edde937e56a3ecbd112ee448c Mon Sep 17 00:00:00 2001 From: Jacob Walls Date: Wed, 10 Jun 2026 16:24:10 -0400 Subject: Fixed #36104 -- Returned NotImplemented in Media.__add__ for non-Media RHS. --- django/forms/widgets.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'django/forms') diff --git a/django/forms/widgets.py b/django/forms/widgets.py index 56ff7bb5ad..82498aa662 100644 --- a/django/forms/widgets.py +++ b/django/forms/widgets.py @@ -262,6 +262,8 @@ class Media: return list(dict.fromkeys(chain.from_iterable(filter(None, lists)))) def __add__(self, other): + if not isinstance(other, Media): + return NotImplemented combined = Media() combined._css_lists = self._css_lists[:] combined._js_lists = self._js_lists[:] -- cgit v1.3