other_viewsets.py 644 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11
from rest_framework.views import APIView
from rest_framework.response import Response
from backend_app.utils import get_viewset_permissions

from django.conf import settings

from shared import OBJ_MODERATION_PERMISSIONS


class AppModerationStatusViewSet(APIView):
    """
Florent Chehab's avatar
Florent Chehab committed
12
    Viewset to know what is the app moderation status
13 14 15 16 17 18 19 20 21 22 23
    """

    permission_classes = get_viewset_permissions("AppModerationStatusViewSet")

    def get(self, request):
        return Response(
            {
                "activated": settings.MODERATION_ACTIVATED,
                "moderator_level": OBJ_MODERATION_PERMISSIONS["moderator"],
            }
        )