Exemplo n.º 1
0
 def create(self, **kwargs):
     comment_data = self.validated_data.pop('comment')
     comment_serializer = CommentSerializer(data=comment_data)
     if comment_serializer.is_valid():
         comment = comment_serializer.create(sender=kwargs['sender'])
         task_comment = models.TaskComment.objects.create(task_id=kwargs['task'], comment_id=comment.id)
         return {'id': task_comment.id, 'comment': comment}
 def create(self, **kwargs):
     comment_data = self.validated_data.pop('comment')
     comment_serializer = CommentSerializer(data=comment_data)
     if comment_serializer.is_valid():
         comment = comment_serializer.create(sender=kwargs['sender'])
         project_comment = models.ProjectComment.objects.create(project_id=kwargs['project'], comment_id=comment.id)
         return {'id': project_comment.id, 'comment': comment}
Exemplo n.º 3
0
 def create(self, **kwargs):
     comment_data = self.validated_data.pop('comment')
     comment_serializer = CommentSerializer(data=comment_data)
     if comment_serializer.is_valid():
         comment = comment_serializer.create(sender=kwargs['sender'])
         project_comment = models.ProjectComment.objects.create(project_id=kwargs['project'], comment_id=comment.id)
         return {'id': project_comment.id, 'comment': comment}
Exemplo n.º 4
0
 def create(self, **kwargs):
     comment_data = self.validated_data.pop("comment")
     comment_serializer = CommentSerializer(data=comment_data)
     if comment_serializer.is_valid():
         comment = comment_serializer.create(sender=kwargs["sender"])
         task_comment = models.TaskComment.objects.create(task_id=kwargs["task"], comment_id=comment.id)
         return {"id": task_comment.id, "comment": comment}
Exemplo n.º 5
0
 def create(self, **kwargs):
     comment_data = self.validated_data.pop('comment')
     comment_serializer = CommentSerializer(data=comment_data)
     if comment_serializer.is_valid():
         comment = comment_serializer.create(sender=kwargs['sender'])
         module_comment = models.ModuleComment.objects.create(module_id=kwargs['module'], comment_id=comment.id)
         return {'id': module_comment.id, 'comment': comment}
Exemplo n.º 6
0
 def create(self, **kwargs):
     comment_data = self.validated_data.pop("comment")
     comment_serializer = CommentSerializer(data=comment_data)
     if comment_serializer.is_valid():
         comment = comment_serializer.create(sender=kwargs["sender"])
         project_comment = models.ProjectComment.objects.create(project_id=kwargs["project"], comment_id=comment.id)
         return {"id": project_comment.id, "comment": comment}
Exemplo n.º 7
0
 def create(self, **kwargs):
     comment_data = self.validated_data.pop('comment')
     comment_serializer = CommentSerializer(data=comment_data)
     if comment_serializer.is_valid():
         comment = comment_serializer.create(sender=kwargs['sender'])
         module_comment = models.ModuleComment.objects.create(
             module_id=kwargs['module'], comment_id=comment.id)
         return {'id': module_comment.id, 'comment': comment}