Commit f994bfcb authored by Aymeric Barantal's avatar Aymeric Barantal
Browse files

use of model .objects to create new one is better

parent 9bc15758
...@@ -17,6 +17,5 @@ class FeedbackViewSet(viewsets.ViewSet): ...@@ -17,6 +17,5 @@ class FeedbackViewSet(viewsets.ViewSet):
category = FeedbackCategory.objects.get(id=request.DATA['category']) category = FeedbackCategory.objects.get(id=request.DATA['category'])
serializer.data['callee'] = callee serializer.data['callee'] = callee
serializer.data['category'] = category serializer.data['category'] = category
feedback = Feedback(**serializer.data) feedback = Feedback.objects.create(**serializer.data)
feedback.save()
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