﻿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
29775	custom url converters are not picked up on reverse when part of included patterns with namespace	Eric Brandwein	Eric Brandwein	"Under normal circumstances, url converters `to_url` methods are called when reversing a url, however, this behavior is inconsistent when used with included sub-patterns, when these sub-patterns have themselves included sub-patterns with a namespace assigned.

To demonstrate:
{{{
from django.urls import path, include, register_converter
from django.urls.converters import StringConverter


class ReverseStringConverter(StringConverter):
    """"""More complex use cases are possible, but this simple case of reversing the string already shows it in effect""""""
    def to_python(self, value):
        return value[::-1]

    def to_url(self, value):
        return value[::-1]


# We just want to test the reverse()
def noop(request, **kwargs):
    pass


register_converter(ReverseStringConverter, 'reverse')

second_layer_urlpatterns = [
    path('', noop, name='failure-view'),
]

first_layer_urlpatterns = [
    path('', include(
        (second_layer_urlpatterns, 'app_name'), namespace='ns')),
    path('', include(second_layer_urlpatterns)),
    path('', noop, name='success-view'),
]

urlpatterns = [
    path('<reverse:param>/', include(first_layer_urlpatterns)),
]

}}}

When running the following test, reverse works fine when reversing `failure-view` or `success-view`, but not when reversing `ns:failure-view`:

{{{
>>> from django.urls import reverse
>>> reverse('failure-view', args=['foo'])
'/oof/'
>>> reverse('ns:failure-view', args=['foo'])
'/foo/'
>>> reverse('success-view', args=['foo'])
'/oof/'
}}}

It probably is very similar to #29415. I tested it in version 2.1.1."	Bug	closed	Core (URLs)	dev	Normal	fixed	converter, namespace, reverse, include	Herbert Fortes	Accepted	1	0	0	0	0	0
