#26945: i18n_patterns returns tuple instead of list
-----------------------------+--------------------
     Reporter:  AlexHill     |      Owner:  nobody
         Type:  Bug          |     Status:  new
    Component:  Core (URLs)  |    Version:  master
     Severity:  Normal       |   Keywords:
 Triage Stage:  Unreviewed   |  Has patch:  0
Easy pickings:  0            |      UI/UX:  0
-----------------------------+--------------------
 In Django 1.10, `i18n_patterns()` returns a tuple when USE_I18N is False.

 I think it should always return a list, given the docs prescribe the use
 of lists for urlpatterns:

   urlpatterns should be a Python list of url() instances.

 As it stands the example given for the usage of `i18n_patterns()` wouldn't
 work with i18n disabled:

 {{{
 #!python
 from django.conf.urls import include, url
 from django.conf.urls.i18n import i18n_patterns

 from about import views as about_views
 from news import views as news_views
 from sitemap.views import sitemap

 urlpatterns = [
     url(r'^sitemap\.xml$', sitemap, name='sitemap-xml'),
 ]

 news_patterns = ([
     url(r'^$', news_views.index, name='index'),
     url(r'^category/(?P<slug>[\w-]+)/$', news_views.category,
 name='category'),
     url(r'^(?P<slug>[\w-]+)/$', news_views.details, name='detail'),
 ], 'news')

 urlpatterns += i18n_patterns(
     url(r'^about/$', about_views.main, name='about'),
     url(r'^news/', include(news_patterns, namespace='news')),
 )
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/26945>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.058611f8d83a07f4a81875a0e87a5bfd%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to