Commit 79d65fae authored by Auke Klazema's avatar Auke Klazema

TMSS-243: Make trailing slash optional for API urls

parent 0cb3dec2
......@@ -75,7 +75,14 @@ class TMSSAPIRootView(routers.APIRootView):
return response
router = routers.DefaultRouter()
class OptionalSlashRouter(routers.DefaultRouter):
def __init__(self):
super(routers.DefaultRouter, self).__init__()
self.trailing_slash = '/?'
router = OptionalSlashRouter()
router.APIRootView = TMSSAPIRootView
router.register(r'tags', viewsets.TagsViewSet)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment