Example #1
0
 def _create_trip(self, data):
     serializer = TripSerializer(data=data)
     serializer.is_valid(raise_exception=True)
     return serializer.create(serializer.validated_data)
Example #2
0
 def _create_trip(self, content):
     serializer = TripSerializer(data=content)
     serializer.is_valid(raise_exception=True)
     trip = serializer.create(serializer.validated_data)
     return trip