Example #1
0
 def update(self, request, *args, **kwargs):
     set_value_in_request(request, Chapter, 'chapter')
     set_user_in_request_data(request)
     story = Story(**request.data)
     story.save()
     logging.info("Story id: " + str(story.id) + " successfully updated.")
     return HttpResponse(story)
Example #2
0
 def update(self, request, *args, **kwargs):
     request.data.pop('stories')
     set_value_in_request(request, Novella, 'novella')
     set_user_in_request_data(request)
     chapter = Chapter(**request.data)
     chapter.save()
     logging.info("Chapter id: " + str(chapter.id) + " successfully updated.")
     return HttpResponse(chapter)