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 @@
from rest_framework.response import Response
from rest_framework import viewsets
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 core.views import can_view, can_edit
......@@ -46,7 +46,7 @@ def check_if(obj, user, test):
class ManageModelMixin:
@detail_route()
@action(detail=True)
def id(self, request, pk=None):
"""
Get by id (api/v1/router/{pk}/id/)
......
......@@ -24,7 +24,7 @@
from rest_framework import serializers
from rest_framework.response import Response
from rest_framework.decorators import list_route
from rest_framework.decorators import action
from counter.models import Counter
......@@ -51,7 +51,7 @@ class CounterViewSet(RightModelViewSet):
serializer_class = CounterSerializer
queryset = Counter.objects.all()
@list_route()
@action(detail=False)
def bar(self, request):
"""
Return all bars (api/v1/counter/bar/)
......
......@@ -24,7 +24,7 @@
from rest_framework import serializers
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
......@@ -96,7 +96,7 @@ class LaunderetteTokenViewSet(RightModelViewSet):
serializer_class = LaunderetteTokenSerializer
queryset = Token.objects.all()
@list_route()
@action(detail=False)
def washing(self, request):
"""
Return all washing tokens (api/v1/launderette/token/washing)
......@@ -105,7 +105,7 @@ class LaunderetteTokenViewSet(RightModelViewSet):
serializer = self.get_serializer(self.queryset, many=True)
return Response(serializer.data)
@list_route()
@action(detail=False)
def drying(self, request):
"""
Return all drying tokens (api/v1/launderette/token/drying)
......@@ -114,7 +114,7 @@ class LaunderetteTokenViewSet(RightModelViewSet):
serializer = self.get_serializer(self.queryset, many=True)
return Response(serializer.data)
@list_route()
@action(detail=False)
def avaliable(self, request):
"""
Return all avaliable tokens (api/v1/launderette/token/avaliable)
......@@ -125,7 +125,7 @@ class LaunderetteTokenViewSet(RightModelViewSet):
serializer = self.get_serializer(self.queryset, many=True)
return Response(serializer.data)
@list_route()
@action(detail=False)
def unavaliable(self, request):
"""
Return all unavaliable tokens (api/v1/launderette/token/unavaliable)
......
......@@ -26,7 +26,7 @@ import datetime
from rest_framework import serializers
from rest_framework.response import Response
from rest_framework.decorators import list_route
from rest_framework.decorators import action
from core.models import User
......@@ -57,7 +57,7 @@ class UserViewSet(RightModelViewSet):
serializer_class = UserSerializer
queryset = User.objects.filter(is_active=True)
@list_route()
@action(detail=False)
def birthday(self, request):
"""
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