def create()

in trackers/api/serializers.py [0:0]


    def create(self, validated_data):
        if "prefix" not in self.context["view"].kwargs.keys():
            prefix = self.context["view"].kwargs["product_prefix"]
            product = get_object_or_404(Product.objects.all(), prefix=prefix)
            validated_data["product"] = product
        return super().create(validated_data)