Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
iannisimo committed Nov 12, 2023
1 parent f9f0f96 commit 7a3c745
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion smartreport_app/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os
from typing import Any
from django.shortcuts import render
from .models import (
KpiReportElement,
Expand Down Expand Up @@ -57,7 +59,11 @@ class DashboardLayoutViewSet(viewsets.ModelViewSet):
filterset_fields = ["user_type"]

class KpiDataViewSet(viewsets.GenericViewSet):
permission_classes = [IsAuthenticated]
def __init__(self, **kwargs: Any) -> None:
if (os.environ.get("DEBUG").lower() == "false"):
self.permission_classes = [IsAuthenticated]
super().__init__(**kwargs)

def list(self, request):
print(type(Kpi.objects.all().get(pk=1)))
return Response({"message": "This endpoint is not available"})
Expand Down

0 comments on commit 7a3c745

Please sign in to comment.