mirror of
https://github.com/django/django.git
synced 2025-11-01 04:17:59 +00:00
Fixed #22486 -- Restored the ability to reverse views created using functools.partial.
Regression in 8b93b31487.
Thanks rcoup for the report.
This commit is contained in:
parent
c3152e5bcd
commit
3c06b2f2a3
7 changed files with 53 additions and 1 deletions
|
|
@ -1,3 +1,5 @@
|
|||
from functools import partial, update_wrapper
|
||||
|
||||
from django.http import HttpResponse
|
||||
from django.views.generic import RedirectView
|
||||
from django.core.urlresolvers import reverse_lazy
|
||||
|
|
@ -55,3 +57,11 @@ def login_required_view(request):
|
|||
|
||||
def bad_view(request, *args, **kwargs):
|
||||
raise ValueError("I don't think I'm getting good value for this view")
|
||||
|
||||
|
||||
empty_view_partial = partial(empty_view, template_name="template.html")
|
||||
|
||||
|
||||
empty_view_wrapped = update_wrapper(
|
||||
partial(empty_view, template_name="template.html"), empty_view,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue