Commit 9a899c25 authored by Christopher Løkken's avatar Christopher Løkken
Browse files

fixed linting

parent 3780067a
......@@ -3,7 +3,8 @@ from meals import views
from rest_framework.urlpatterns import format_suffix_patterns
meal_url_patterns = [
path("",
path(
"",
views.MealList.as_view(),
name="meal-list"),
path(
......
......@@ -30,6 +30,7 @@ import base64
import pickle
from django.core.signing import Signer
class MealList(
mixins.ListModelMixin, mixins.CreateModelMixin, generics.GenericAPIView
):
......
......@@ -2,6 +2,7 @@ from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework.reverse import reverse
@api_view(["GET"])
def api_root(request, format=None):
return Response(
......
......@@ -14,7 +14,8 @@ users_url_patterns = [
]
offers_url_patterns = [
path("",
path(
"",
views.OfferList.as_view(),
name="offer-list"),
path(
......
......@@ -34,11 +34,11 @@ from workouts.serializers import ExerciseInstanceSerializer, WorkoutFileSerializ
# Allow users to save a persistent session in their browser
class RememberMe(
mixins.ListModelMixin,
mixins.CreateModelMixin,
mixins.DestroyModelMixin,
generics.GenericAPIView,
):
mixins.ListModelMixin,
mixins.CreateModelMixin,
mixins.DestroyModelMixin,
generics.GenericAPIView,
):
serializer_class = RememberMeSerializer
......@@ -47,6 +47,7 @@ class RememberMe(
raise PermissionDenied
else:
return Response({"remember_me": self.rememberme()})
def post(self, request):
cookie_object = namedtuple("Cookies", request.COOKIES.keys())(
*request.COOKIES.values()
......@@ -79,10 +80,10 @@ class RememberMe(
class WorkoutList(
mixins.ListModelMixin,
mixins.CreateModelMixin,
generics.GenericAPIView
):
mixins.ListModelMixin,
mixins.CreateModelMixin,
generics.GenericAPIView
):
"""Class defining the web response for the creation of a Workout, or displaying a list
of Workouts
......@@ -125,11 +126,11 @@ class WorkoutList(
class WorkoutDetail(
mixins.RetrieveModelMixin,
mixins.UpdateModelMixin,
mixins.DestroyModelMixin,
generics.GenericAPIView,
):
mixins.RetrieveModelMixin,
mixins.UpdateModelMixin,
mixins.DestroyModelMixin,
generics.GenericAPIView,
):
"""Class defining the web response for the details of an individual Workout.
HTTP methods: GET, PUT, DELETE
......@@ -154,10 +155,10 @@ class WorkoutDetail(
class ExerciseList(
mixins.ListModelMixin,
mixins.CreateModelMixin,
generics.GenericAPIView
):
mixins.ListModelMixin,
mixins.CreateModelMixin,
generics.GenericAPIView
):
"""Class defining the web response for the creation of an Exercise, or
a list of Exercises.
......@@ -176,11 +177,11 @@ class ExerciseList(
class ExerciseDetail(
mixins.RetrieveModelMixin,
mixins.UpdateModelMixin,
mixins.DestroyModelMixin,
generics.GenericAPIView,
):
mixins.RetrieveModelMixin,
mixins.UpdateModelMixin,
mixins.DestroyModelMixin,
generics.GenericAPIView,
):
"""Class defining the web response for the details of an individual Exercise.
HTTP methods: GET, PUT, PATCH, DELETE
......@@ -204,11 +205,11 @@ class ExerciseDetail(
class ExerciseInstanceList(
mixins.ListModelMixin,
mixins.CreateModelMixin,
CreateListModelMixin,
generics.GenericAPIView,
):
mixins.ListModelMixin,
mixins.CreateModelMixin,
CreateListModelMixin,
generics.GenericAPIView,
):
"""Class defining the web response for the creation"""
serializer_class = ExerciseInstanceSerializer
......@@ -235,11 +236,11 @@ class ExerciseInstanceList(
class ExerciseInstanceDetail(
mixins.RetrieveModelMixin,
mixins.UpdateModelMixin,
mixins.DestroyModelMixin,
generics.GenericAPIView,
):
mixins.RetrieveModelMixin,
mixins.UpdateModelMixin,
mixins.DestroyModelMixin,
generics.GenericAPIView,
):
serializer_class = ExerciseInstanceSerializer
permission_classes = [
permissions.IsAuthenticated
......@@ -263,11 +264,11 @@ class ExerciseInstanceDetail(
class WorkoutFileList(
mixins.ListModelMixin,
mixins.CreateModelMixin,
CreateListModelMixin,
generics.GenericAPIView,
):
mixins.ListModelMixin,
mixins.CreateModelMixin,
CreateListModelMixin,
generics.GenericAPIView,
):
queryset = WorkoutFile.objects.all()
serializer_class = WorkoutFileSerializer
......@@ -299,11 +300,11 @@ class WorkoutFileList(
class WorkoutFileDetail(
mixins.RetrieveModelMixin,
mixins.UpdateModelMixin,
mixins.DestroyModelMixin,
generics.GenericAPIView,
):
mixins.RetrieveModelMixin,
mixins.UpdateModelMixin,
mixins.DestroyModelMixin,
generics.GenericAPIView,
):
queryset = WorkoutFile.objects.all()
serializer_class = WorkoutFileSerializer
......
Supports Markdown
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