Created
October 25, 2018 08:06
-
-
Save esirK/94ad9f67acc7e7462036485bb4322a3e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def put(self, request, pk): | |
saved_article = get_object_or_404(Article.objects.all(), pk=pk) | |
data = request.data.get('article') | |
serializer = ArticleSerializer(instance=saved_article, data=data, partial=True | |
if serializer.is_valid(raise_exception=True): | |
article_saved = serializer.save() | |
return Response({"success": "Article '{}' updated successfully".format(article_saved.title)}) |
seems like you missed to close parenthesis on line 4
Thanks for the catch @racyriaz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
seems like you missed to close parenthesis on line 4