#30731: django.contrib.admindocs.utils.replace_named_groups() fails 
substitution if
missing trailing /
---------------------------------------------+------------------------
               Reporter:  n2ygk              |          Owner:  nobody
                   Type:  Bug                |         Status:  new
              Component:  contrib.admindocs  |        Version:  2.2
               Severity:  Normal             |       Keywords:
           Triage Stage:  Unreviewed         |      Has patch:  0
    Needs documentation:  0                  |    Needs tests:  0
Patch needs improvement:  0                  |  Easy pickings:  0
                  UI/UX:  0                  |
---------------------------------------------+------------------------
 replace_named_groups() fails to replace the final named group if the
 urlpattern passed in is missing a trailing '/'.

 For example, with input
 `r'entries/(?P<pk>[^/.]+)/relationships/(?P<related_field>\w+)'` the
 "related_field" does not get properly replaced.  A workaround is to tack
 on a '/' at the end and then it works.

 Code that reproduces this is attached.

 This function is used downstream in Django REST Framework. See issue
 [[https://github.com/encode/django-rest-framework/issues/6888|6888]]

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30731>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/048.85e9867d76b229bd03ba9f7b867b7ecb%40djangoproject.com.

Reply via email to