8000 Fixed #32208 -- fixed misinterpretation of "__proxy__" as TypeError. by Blackeyeforreal · Pull Request #13707 · django/django · GitHub
[go: up one dir, main page]

Skip to content

Fixed #32208 -- fixed misinterpretation of "__proxy__" as TypeError. #13707

New issue
< 8000 div class="px-4">

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from
Prev Previous commit
Next Next commit
Fixed #32208 -- fixed misinterpretation of "__proxy__" as TypeError .
tweaked exception handling of add built in filter , to support (gettext
_lazy). as previously it was taking it as a TypeError and used to
return a string.
  • Loading branch information
Blackeyeforreal committed Nov 22, 2020
commit 726ecdc8bc7776ffe802478a786518b8ffff1fa8
2 changes: 1 addition & 1 deletion django/shortcuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,4 @@ def resolve_url(to, *args, **kwargs):

# Finally, fall back and assume it's a URL
return to

2 changes: 1 addition & 1 deletion django/template/defaultfilters.py
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ def add(value, arg):
return value + proxy_arg
except Exception:
return ''


@register.filter(is_safe=False)
def get_digit(value, arg):
Expand Down
2 changes: 1 addition & 1 deletion tests/template_tests/filter_tests/test_add.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test_add06(self):
def test_add07(self):
output = self.engine.render_to_string('add07', {'d': date(2000, 1, 1), 't': timedelta(10)})
self.assertEqual(output, 'Jan. 11, 2000')

@setup({'add08': '{{ s1|add:lazy_s2 }}'})
def test_add08(self):
from django.utils.translation import gettext_lazy
Expand Down
0