Skip to content

Commit

Permalink
API: Fix url_path for numberical URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Sep 18, 2020
1 parent dfd1be0 commit 2c56345
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions weblate/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def notifications(self, request, **kwargs):
@action(
detail=True,
methods=["get", "put", "patch", "delete"],
url_path="notifications/(?P<subscription_id>[^/.]+)",
url_path="notifications/(?P<subscription_id>[0-9]+)",
serializer_class=NotificationSerializer,
)
def notifications_details(self, request, username, subscription_id):
Expand Down Expand Up @@ -500,7 +500,7 @@ def projects(self, request, **kwargs):

return Response(serializer.data, status=HTTP_200_OK)

@action(detail=True, methods=["delete"], url_path="projects/(?P<project_id>[^/.]+)")
@action(detail=True, methods=["delete"], url_path="projects/(?P<project_id>[0-9]+)")
def delete_projects(self, request, id, project_id):
obj = self.get_object()
self.perm_check(request)
Expand Down Expand Up @@ -534,7 +534,7 @@ def componentlists(self, request, **kwargs):
@action(
detail=True,
methods=["delete"],
url_path="componentlists/(?P<component_list_id>[^/.]+)",
url_path="componentlists/(?P<component_list_id>[0-9]+)",
)
def delete_componentlists(self, request, id, component_list_id):
obj = self.get_object()
Expand Down Expand Up @@ -570,7 +570,7 @@ def components(self, request, **kwargs):
return Response(serializer.data, status=HTTP_200_OK)

@action(
detail=True, methods=["delete"], url_path="components/(?P<component_id>[^/.]+)"
detail=True, methods=["delete"], url_path="components/(?P<component_id>[0-9]+)"
)
def delete_components(self, request, id, component_id):
obj = self.get_object()
Expand Down Expand Up @@ -1132,7 +1132,7 @@ def units(self, request, **kwargs):

return Response(serializer.data, status=HTTP_200_OK)

@action(detail=True, methods=["delete"], url_path="units/(?P<unit_id>[^/.]+)")
@action(detail=True, methods=["delete"], url_path="units/(?P<unit_id>[0-9]+)")
def delete_units(self, request, pk, unit_id):
obj = self.get_object()
if not request.user.has_perm("screenshot.edit", obj.component):
Expand Down

0 comments on commit 2c56345

Please sign in to comment.