Verified Commit c3f2d0a1 authored by Sli's avatar Sli
Browse files

django2.2: unlock djangorestframework version limit

parent cd2d3ee6
Pipeline #2066 passed with stage
in 40 minutes and 28 seconds
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
from rest_framework.response import Response from rest_framework.response import Response
from rest_framework import viewsets from rest_framework import viewsets
from django.core.exceptions import PermissionDenied from django.core.exceptions import PermissionDenied
from rest_framework.decorators import detail_route from rest_framework.decorators import action
from django.db.models.query import QuerySet from django.db.models.query import QuerySet
from core.views import can_view, can_edit from core.views import can_view, can_edit
...@@ -46,7 +46,7 @@ def check_if(obj, user, test): ...@@ -46,7 +46,7 @@ def check_if(obj, user, test):
class ManageModelMixin: class ManageModelMixin:
@detail_route() @action(detail=True)
def id(self, request, pk=None): def id(self, request, pk=None):
""" """
Get by id (api/v1/router/{pk}/id/) Get by id (api/v1/router/{pk}/id/)
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
from rest_framework import serializers from rest_framework import serializers
from rest_framework.response import Response from rest_framework.response import Response
from rest_framework.decorators import list_route from rest_framework.decorators import action
from counter.models import Counter from counter.models import Counter
...@@ -51,7 +51,7 @@ class CounterViewSet(RightModelViewSet): ...@@ -51,7 +51,7 @@ class CounterViewSet(RightModelViewSet):
serializer_class = CounterSerializer serializer_class = CounterSerializer
queryset = Counter.objects.all() queryset = Counter.objects.all()
@list_route() @action(detail=False)
def bar(self, request): def bar(self, request):
""" """
Return all bars (api/v1/counter/bar/) Return all bars (api/v1/counter/bar/)
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
from rest_framework import serializers from rest_framework import serializers
from rest_framework.response import Response from rest_framework.response import Response
from rest_framework.decorators import list_route from rest_framework.decorators import action
from launderette.models import Launderette, Machine, Token from launderette.models import Launderette, Machine, Token
...@@ -96,7 +96,7 @@ class LaunderetteTokenViewSet(RightModelViewSet): ...@@ -96,7 +96,7 @@ class LaunderetteTokenViewSet(RightModelViewSet):
serializer_class = LaunderetteTokenSerializer serializer_class = LaunderetteTokenSerializer
queryset = Token.objects.all() queryset = Token.objects.all()
@list_route() @action(detail=False)
def washing(self, request): def washing(self, request):
""" """
Return all washing tokens (api/v1/launderette/token/washing) Return all washing tokens (api/v1/launderette/token/washing)
...@@ -105,7 +105,7 @@ class LaunderetteTokenViewSet(RightModelViewSet): ...@@ -105,7 +105,7 @@ class LaunderetteTokenViewSet(RightModelViewSet):
serializer = self.get_serializer(self.queryset, many=True) serializer = self.get_serializer(self.queryset, many=True)
return Response(serializer.data) return Response(serializer.data)
@list_route() @action(detail=False)
def drying(self, request): def drying(self, request):
""" """
Return all drying tokens (api/v1/launderette/token/drying) Return all drying tokens (api/v1/launderette/token/drying)
...@@ -114,7 +114,7 @@ class LaunderetteTokenViewSet(RightModelViewSet): ...@@ -114,7 +114,7 @@ class LaunderetteTokenViewSet(RightModelViewSet):
serializer = self.get_serializer(self.queryset, many=True) serializer = self.get_serializer(self.queryset, many=True)
return Response(serializer.data) return Response(serializer.data)
@list_route() @action(detail=False)
def avaliable(self, request): def avaliable(self, request):
""" """
Return all avaliable tokens (api/v1/launderette/token/avaliable) Return all avaliable tokens (api/v1/launderette/token/avaliable)
...@@ -125,7 +125,7 @@ class LaunderetteTokenViewSet(RightModelViewSet): ...@@ -125,7 +125,7 @@ class LaunderetteTokenViewSet(RightModelViewSet):
serializer = self.get_serializer(self.queryset, many=True) serializer = self.get_serializer(self.queryset, many=True)
return Response(serializer.data) return Response(serializer.data)
@list_route() @action(detail=False)
def unavaliable(self, request): def unavaliable(self, request):
""" """
Return all unavaliable tokens (api/v1/launderette/token/unavaliable) Return all unavaliable tokens (api/v1/launderette/token/unavaliable)
......
...@@ -26,7 +26,7 @@ import datetime ...@@ -26,7 +26,7 @@ import datetime
from rest_framework import serializers from rest_framework import serializers
from rest_framework.response import Response from rest_framework.response import Response
from rest_framework.decorators import list_route from rest_framework.decorators import action
from core.models import User from core.models import User
...@@ -57,7 +57,7 @@ class UserViewSet(RightModelViewSet): ...@@ -57,7 +57,7 @@ class UserViewSet(RightModelViewSet):
serializer_class = UserSerializer serializer_class = UserSerializer
queryset = User.objects.filter(is_active=True) queryset = User.objects.filter(is_active=True)
@list_route() @action(detail=False)
def birthday(self, request): def birthday(self, request):
""" """
Return all users born today (api/v1/user/birstdays) Return all users born today (api/v1/user/birstdays)
......
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