Commit 2474c53e authored by Christopher Løkken's avatar Christopher Løkken
Browse files

fixed linting

parent 1346592e
Pipeline #171129 passed with stages
in 1 minute and 9 seconds
......@@ -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(
......
......@@ -3,7 +3,6 @@
import base64
import pickle
from collections import namedtuple
import re
from rest_framework import generics, mixins
from rest_framework import permissions
......@@ -11,7 +10,6 @@ from rest_framework.parsers import (
JSONParser,
)
from rest_framework.response import Response
from rest_framework.reverse import reverse
from rest_framework import filters
from rest_framework_simplejwt.tokens import RefreshToken
from django.db.models import Q
......@@ -36,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
......@@ -49,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()
......@@ -81,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
......@@ -127,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
......@@ -156,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.
......@@ -178,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
......@@ -206,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
......@@ -237,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
......@@ -265,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
......@@ -301,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