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