Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency djangorestframework to 3.12.* #2268

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions normandy/base/api/routers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ def get_urls(self):

return urls

def register(self, prefix, viewset, base_name=None, allow_cdn=True):
def register(self, prefix, viewset, basename=None, allow_cdn=True):
if not allow_cdn:
raise NotImplementedError("Can't pass allow_cdn=False for viewsets")
super().register(prefix, viewset, base_name=base_name)
super().register(prefix, viewset, basename=basename)

def register_view(self, prefix, View, *, name, allow_cdn=True, **kwargs):
url_pattern = url(r"^{}/$".format(prefix), View.as_view(), name=name, **kwargs)
Expand Down
5 changes: 2 additions & 3 deletions normandy/base/api/utils.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import re

from django.contrib.admindocs.views import simplify_regex

from rest_framework.compat import URLPattern, URLResolver, get_original_route
from django.urls import URLPattern, URLResolver


_PATH_PARAMETER_COMPONENT_RE = re.compile(r"<(?:(?P<converter>[^>:]+):)?(?P<parameter>\w+)>")
Expand Down Expand Up @@ -72,7 +71,7 @@ def get_api_endpoints(patterns=None, namespace="", prefix=""):
api_endpoints = []

for pattern in patterns:
path_regex = prefix + get_original_route(pattern)
path_regex = prefix + str(pattern.pattern)

if isinstance(pattern, URLPattern):
path = get_path_from_regex(path_regex)
Expand Down
11 changes: 7 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ django-npm = "^1.0.0"
django-storages = "^1.7.2"
django_csp = "^3.5"
# DRF does not follow semver, 3.11 is a breaking change
djangorestframework = "3.10.*"
djangorestframework = "3.12.*"
djangorestframework-yaml = "^2.0.0"
dockerflow = "^2020.0.0"
drf-yasg = "^1.17.0"
Expand Down