mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-07 22:04:48 +03:00
Django 1.9 uses urlpattern.callback; added support while keeping backwards compatibility
This commit is contained in:
parent
689afd83cc
commit
a74b3a711e
|
@ -24,7 +24,7 @@ def apply_suffix_patterns(urlpatterns, suffix_pattern, suffix_required):
|
|||
else:
|
||||
# Regular URL pattern
|
||||
regex = urlpattern.regex.pattern.rstrip('$').rstrip('/') + suffix_pattern
|
||||
view = urlpattern._callback or urlpattern._callback_str
|
||||
view = getattr(urlpattern, 'callback', None) or urlpattern._callback or urlpattern._callback_str
|
||||
kwargs = urlpattern.default_args
|
||||
name = urlpattern.name
|
||||
# Add in both the existing and the new urlpattern
|
||||
|
|
Loading…
Reference in New Issue
Block a user