Skip to content

Commit 29eb776

Browse files
committed
add trailing /$ to urlpatterns
- works around a bug in django.contrib.admindocs.utils.replace_named_groups that fails to replace a named group if there's no trailing / - only make the change to urls.py; urls_test.py has a bunch of tests that expect the / to be missing.
1 parent 4e9b43c commit 29eb776

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

example/urls.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -30,37 +30,37 @@
3030

3131
urlpatterns = [
3232
url(r'^', include(router.urls)),
33-
url(r'^entries/(?P<entry_pk>[^/.]+)/suggested/',
33+
url(r'^entries/(?P<entry_pk>[^/.]+)/suggested/$',
3434
EntryViewSet.as_view({'get': 'list'}),
3535
name='entry-suggested'
3636
),
37-
url(r'entries/(?P<entry_pk>[^/.]+)/blog',
37+
url(r'entries/(?P<entry_pk>[^/.]+)/blog/$',
3838
BlogViewSet.as_view({'get': 'retrieve'}),
3939
name='entry-blog'),
40-
url(r'entries/(?P<entry_pk>[^/.]+)/comments',
40+
url(r'entries/(?P<entry_pk>[^/.]+)/comments/$',
4141
CommentViewSet.as_view({'get': 'list'}),
4242
name='entry-comments'),
43-
url(r'entries/(?P<entry_pk>[^/.]+)/authors',
43+
url(r'entries/(?P<entry_pk>[^/.]+)/authors/$',
4444
AuthorViewSet.as_view({'get': 'list'}),
4545
name='entry-authors'),
46-
url(r'entries/(?P<entry_pk>[^/.]+)/featured',
46+
url(r'entries/(?P<entry_pk>[^/.]+)/featured/$',
4747
EntryViewSet.as_view({'get': 'retrieve'}),
4848
name='entry-featured'),
4949

5050
url(r'^authors/(?P<pk>[^/.]+)/(?P<related_field>\w+)/$',
5151
AuthorViewSet.as_view({'get': 'retrieve_related'}),
5252
name='author-related'),
5353

54-
url(r'^entries/(?P<pk>[^/.]+)/relationships/(?P<related_field>\w+)',
54+
url(r'^entries/(?P<pk>[^/.]+)/relationships/(?P<related_field>\w+)/$',
5555
EntryRelationshipView.as_view(),
5656
name='entry-relationships'),
57-
url(r'^blogs/(?P<pk>[^/.]+)/relationships/(?P<related_field>\w+)',
57+
url(r'^blogs/(?P<pk>[^/.]+)/relationships/(?P<related_field>\w+)/$',
5858
BlogRelationshipView.as_view(),
5959
name='blog-relationships'),
60-
url(r'^comments/(?P<pk>[^/.]+)/relationships/(?P<related_field>\w+)',
60+
url(r'^comments/(?P<pk>[^/.]+)/relationships/(?P<related_field>\w+)/$',
6161
CommentRelationshipView.as_view(),
6262
name='comment-relationships'),
63-
url(r'^authors/(?P<pk>[^/.]+)/relationships/(?P<related_field>\w+)',
63+
url(r'^authors/(?P<pk>[^/.]+)/relationships/(?P<related_field>\w+)/$',
6464
AuthorRelationshipView.as_view(),
6565
name='author-relationships'),
6666
]

0 commit comments

Comments
 (0)