Commit 0dd5e495 authored by okhin's avatar okhin

Fixing the feedback serializer

parent f3ab1469
Pipeline #841 passed with stages
in 46 seconds
...@@ -3,7 +3,7 @@ from rest_framework.response import Response ...@@ -3,7 +3,7 @@ from rest_framework.response import Response
from picampaign.feedback.serializers import FeedbackSerializer from picampaign.feedback.serializers import FeedbackSerializer
from picampaign.feedback.models import Feedback, FeedbackCategory from picampaign.feedback.models import Feedback, FeedbackCategory
from picampaign.campaign.models import CampaignContact from picampaign.contact.models import Contact
class FeedbackViewSet(viewsets.ViewSet): class FeedbackViewSet(viewsets.ViewSet):
...@@ -14,5 +14,5 @@ class FeedbackViewSet(viewsets.ViewSet): ...@@ -14,5 +14,5 @@ class FeedbackViewSet(viewsets.ViewSet):
def create(self, request, campaign_pk=None): def create(self, request, campaign_pk=None):
serializer = FeedbackSerializer(data=request.data) serializer = FeedbackSerializer(data=request.data)
serializer.is_valid() serializer.is_valid()
feedback = Feedback.objects.create(**serializer.validated_data) feedback = Feedback.objects.create(callee=serializer.validated_data.pop('callee'), **serializer.validated_data)
return Response(feedback.id) return Response(feedback.id)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment