Commit 79c99791 authored by axelkjonsberg's avatar axelkjonsberg
Browse files

Remove unneeded comments

Either where code functionality is self evident or where the comment's content is better left to other types of documentation
parent 63108493
Pipeline #128410 failed with stage
in 1 minute and 2 seconds
......@@ -4,7 +4,6 @@ from django.db import models
from workouts.models import Workout
# Create your models here.
class Comment(models.Model):
"""Django model for a comment left on a workout.
......
......@@ -8,7 +8,6 @@ from comments.serializers import CommentSerializer
from workouts.permissions import IsOwner, IsReadOnly
# Create your views here.
class CommentList(
mixins.ListModelMixin, mixins.CreateModelMixin, generics.GenericAPIView
):
......@@ -56,7 +55,6 @@ class CommentList(
return qs
# Details of comment
class CommentDetail(
mixins.RetrieveModelMixin,
mixins.UpdateModelMixin,
......
......@@ -45,7 +45,6 @@ class UserSerializer(serializers.HyperlinkedModelSerializer):
except forms.ValidationError as error: # pragma no cover
raise serializers.ValidationError(error.messages)
# Fix for unequal passwords getting accepted
if password != password1:
raise serializers.ValidationError(detail="Passwords did not match")
......
......@@ -14,7 +14,6 @@ from workouts.parsers import MultipartJsonParser
from workouts.permissions import IsOwner, IsReadOnly
# Create your views here.
class UserList(mixins.ListModelMixin, mixins.CreateModelMixin, generics.GenericAPIView):
serializer_class = UserSerializer
users = []
......
......@@ -26,7 +26,6 @@ class OverwriteStorage(FileSystemStorage):
os.remove(os.path.join(settings.MEDIA_ROOT, name))
# Create your models here.
class Workout(models.Model):
"""Django model for a workout that users can log.
......@@ -48,15 +47,14 @@ class Workout(models.Model):
get_user_model(), on_delete=models.CASCADE, related_name="workouts"
)
# Visibility levels
PUBLIC = "PU" # Visible to all authenticated users
COACH = "CO" # Visible only to owner and their coach
PRIVATE = "PR" # Visible only to owner
PUBLIC = "PU"
COACH = "CO"
PRIVATE = "PR"
VISIBILITY_CHOICES = [
(PUBLIC, "Public"),
(COACH, "Coach"),
(PRIVATE, "Private"),
] # Choices for visibility level
]
visibility = models.CharField(
max_length=2, choices=VISIBILITY_CHOICES, default=COACH
......@@ -108,8 +106,8 @@ class ExerciseInstance(models.Model):
exercise = models.ForeignKey(
Exercise, on_delete=models.CASCADE, related_name="instances"
)
sets = models.PositiveIntegerField() # Fix for negative sets allowed
number = models.PositiveIntegerField() # Fix for negative number allowed
sets = models.PositiveIntegerField()
number = models.PositiveIntegerField()
def workout_directory_path(instance, filename):
......
......@@ -5,7 +5,6 @@ from rest_framework_simplejwt.views import (TokenObtainPairView,
from workouts import views
# This is a bit messy and will need to change
urlpatterns = format_suffix_patterns(
[
path("", views.api_root),
......
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