Commit 0f8907d4 authored by Ale's avatar Ale

feat: Serialize only published Testimony objects

parent 9f4ecdcf
......@@ -9,21 +9,6 @@ from rest_framework import viewsets
from apps.map import models
from .serializers import TestimonySerializer
#def testimonies(request):
# testimonies = Testimony.objects.all().order_by('name');
# if testimonies:
# data = TestimonySerializer(testimonies, many=True).data
# return JsonResponse(
# data,
# safe=False,
# status=200,
# )
# return JsonReponse(
# [],
# safe=False,
# status=200,
# )
# return HttpResponse(status=403)
class TestimonyViewSet(viewsets.ModelViewSet):
queryset = models.Testimony.objects.all().order_by('name')
queryset = models.Testimony.objects.filter(published=True).order_by('name')
serializer_class = TestimonySerializer
Markdown is supported
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