Skip to content

Commit

Permalink
Tickets done
Browse files Browse the repository at this point in the history
  • Loading branch information
ankurr0y committed Jan 24, 2024
1 parent df3d09a commit 3c1a7e6
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/events/views/api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from rest_framework import viewsets
from events.serializers.serializers import *
from rest_framework.permissions import IsAuthenticatedOrReadOnly
from rest_framework.permissions import IsAuthenticatedOrReadOnly, AllowAny, IsAuthenticated
from events.models.costs import Costs
from events.models.event import Event
from events.models.participant import Participant
Expand All @@ -10,7 +10,7 @@

class CostsViewSet(viewsets.ReadOnlyModelViewSet):
serializer_class = CostsSerializer
permission_classes = [IsAuthenticatedOrReadOnly]
permission_classes = [AllowAny]
queryset = Costs.objects.all()

class EventViewSet(viewsets.ReadOnlyModelViewSet):
Expand All @@ -34,6 +34,10 @@ def get_queryset(self):

class TicketViewSet(viewsets.ReadOnlyModelViewSet):
serializer_class = TicketSerializer
permission_classes = [IsAuthenticatedOrReadOnly]
queryset = Ticket.objects.all()
permission_classes = [IsAuthenticated]

def get_queryset(self):
user = self.request.user
queryset = EventApplication.objects.filter(owner=user)
return queryset

0 comments on commit 3c1a7e6

Please sign in to comment.