Commit 56e8b4fd authored by Morten Nordseth's avatar Morten Nordseth
Browse files

fix artificial coupling - moved visibility class out of workouts file

parent bd3e105b
Pipeline #129384 canceled with stages
from rest_framework import permissions
from workouts.models import Visibility
from secfit.enums import Visibility
class IsCommentVisibleToUser(permissions.BasePermission):
......
......@@ -6,7 +6,7 @@ from workouts.permissions import IsOwner, IsReadOnly
from comments.serializers import CommentSerializer
from django.db.models import Q
from rest_framework.filters import OrderingFilter
from workouts.models import Visibility
from secfit.enums import Visibility
class CommentList(
......
from django.utils.translation import gettext_lazy as _
from django.db import models
class Visibility(models.TextChoices):
PUBLIC = "PU", _("Public")
COACH = "CO", _("Coach")
PRIVATE = "PR", _("Private")
......@@ -7,8 +7,7 @@ from django.db import models
from django.core.files.storage import FileSystemStorage
from django.conf import settings
from django.contrib.auth import get_user_model
from django.utils.translation import gettext_lazy as _
from secfit.enums import Visibility
class OverwriteStorage(FileSystemStorage):
"""Filesystem storage for overwriting files. Currently unused."""
......@@ -26,10 +25,6 @@ class OverwriteStorage(FileSystemStorage):
os.remove(os.path.join(settings.MEDIA_ROOT, name))
class Visibility(models.TextChoices):
PUBLIC = "PU", _("Public")
COACH = "CO", _("Coach")
PRIVATE = "PR", _("Private")
class Workout(models.Model):
......
......@@ -2,7 +2,7 @@
"""
from rest_framework import permissions
from workouts.models import Workout
from workouts.models import Visibility
from secfit.enums import Visibility
class IsOwner(permissions.BasePermission):
......
......@@ -36,7 +36,7 @@ from collections import namedtuple
import base64
import pickle
from django.core.signing import Signer
from workouts.models import Visibility
from secfit.enums import Visibility
@api_view(["GET"])
......
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