﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
26039	Bug with Views being nested partials	Grégory Starck	nobody	"If you define a view `v2` like this:

{{{
def view(request):
    pass

v1 = functools.partial(view)
v2 = functools.partial(v1)
}}}

then set `v2` as the view for some url, then you'll get an attribute error if you try reverse() on it :

AttributeError: 'functools.partial' object has no attribute '__module__'

{{{
  File ""/home/gstarck/work/public/python/django-all/django/django/urls/base.py"", line 91, in reverse
    return force_text(iri_to_uri(resolver._reverse_with_prefix(view, prefix, *args, **kwargs)))
  File ""/home/gstarck/work/public/python/django-all/django/django/urls/resolvers.py"", line 323, in _reverse_with_prefix
    self._populate()
  File ""/home/gstarck/work/public/python/django-all/django/django/urls/resolvers.py"", line 183, in _populate
    self._callback_strs.add(pattern.lookup_str)
  File ""/home/gstarck/work/public/python/django-all/django/django/utils/functional.py"", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File ""/home/gstarck/work/public/python/django-all/django/django/urls/resolvers.py"", line 141, in lookup_str
    return callback.__module__ + ""."" + callback.__class__.__name__
AttributeError: 'functools.partial' object has no attribute '__module__'
}}}

I have a patch / test case for this.."	Bug	closed	Core (URLs)	dev	Normal	fixed	reverse partial url		Accepted	1	0	0	0	0	0
