Skip to content

Commit

Permalink
Remove include compat
Browse files Browse the repository at this point in the history
  • Loading branch information
carltongibson committed Oct 5, 2017
1 parent a65f141 commit 907d6ab
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
9 changes: 0 additions & 9 deletions rest_framework/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,15 +305,6 @@ def set_rollback():
pass


# TODO: Remove
def include(module, namespace=None, app_name=None):
from django.conf.urls import include
if django.VERSION < (1,9):
return include(module, namespace, app_name)
else:
return include((module, app_name), namespace)


def authenticate(request=None, **credentials):
from django.contrib.auth import authenticate
if django.VERSION < (1, 11):
Expand Down
7 changes: 3 additions & 4 deletions rest_framework/urlpatterns.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from __future__ import unicode_literals

from django.conf.urls import url
from django.conf.urls import include, url

from rest_framework.compat import RegexURLResolver, include
from rest_framework.compat import RegexURLResolver
from rest_framework.settings import api_settings


Expand All @@ -19,8 +19,7 @@ def apply_suffix_patterns(urlpatterns, suffix_pattern, suffix_required):
patterns = apply_suffix_patterns(urlpattern.url_patterns,
suffix_pattern,
suffix_required)
ret.append(url(regex, include(patterns, namespace, app_name), kwargs))

ret.append(url(regex, include((patterns, app_name), namespace), kwargs))
else:
# Regular URL pattern
regex = urlpattern.regex.pattern.rstrip('$').rstrip('/') + suffix_pattern
Expand Down

0 comments on commit 907d6ab

Please sign in to comment.