from rest_framework import generics, serializers
from rest_framework.permissions import IsAuthenticated
class TicketFormView(generics.CreateAPIView):
serializer_class = TicketSerializer
queryset = Ticket.objects.all()
permission_classes = ( IsAuthenticated, )
def perform_create(self, serializer):
serializer.save(created_by=self.request.user)