{"action":"created","comment":{"url":"https://api.github.com/repos/better1992/guestbook/pulls/comments/34536395","id":34536395,"diff_hunk":"@@ -56,37 +39,25 @@ def post(self, request, *args, **kwargs):\n \t\t\t# valid json\n \t\t\trequest.POST = json_object\n \n+\t\tcontent = request.POST.get('greeting_message')\n \t\tguestbook_name = kwargs.get('guestbook_name')\n-\t\tif (guestbook_name is None) | (request.POST.get('greeting_message') is None):\n-\t\t\treturn HttpResponse(status=400)\n-\t\tdict_parameter = {\n-\t\t\t'guestbook_name': guestbook_name,\n-\t\t\t'greeting_message': request.POST.get('greeting_message')\n-\t\t}\n \n-\t\tif Greeting.put_from_dict(dict_parameter):\n-\t\t\treturn HttpResponse(status=204)\n-\t\telse:\n-\t\t\treturn HttpResponse(status=404)\n+\t\tform = self.get_form(self.form_class)\n+\t\tif not form.is_valid():\n+\t\t\treturn HttpResponse(status=400)\n \n+\t\treturn GreetingService.create(guestbook_name=guestbook_name, content=content)","path":"guestbook/guestbookapp/api.py","position":74,"original_position":74,"commit_id":"fb7d220bbb7bb671e8feeb2b640816908920c7e7","original_commit_id":"fb7d220bbb7bb671e8feeb2b640816908920c7e7","user":{"login":"phucnpm","id":7623464,"avatar_url":"https://avatars.githubusercontent.com/u/7623464?v=3","gravatar_id":"","url":"https://api.github.com/users/phucnpm","html_url":"https://github.com/phucnpm","followers_url":"https://api.github.com/users/phucnpm/followers","following_url":"https://api.github.com/users/phucnpm/following{/other_user}","gists_url":"https://api.github.com/users/phucnpm/gists{/gist_id}","starred_url":"https://api.github.com/users/phucnpm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phucnpm/subscriptions","organizations_url":"https://api.github.com/users/phucnpm/orgs","repos_url":"https://api.github.com/users/phucnpm/repos","events_url":"https://api.github.com/users/phucnpm/events{/privacy}","received_events_url":"https://api.github.com/users/phucnpm/received_events","type":"User","site_admin":false},"body":"mọi thông tin truyền qua service phải là thông tin hợp lẹ `form.cleaned_data`","created_at":"2015-07-14T04:28:33Z","updated_at":"2015-07-14T04:28:33Z","html_url":"https://github.com/better1992/guestbook/pull/16#discussion_r34536395","pull_request_url":"https://api.github.com/repos/better1992/guestbook/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/better1992/guestbook/pulls/comments/34536395"},"html":{"href":"https://github.com/better1992/guestbook/pull/16#discussion_r34536395"},"pull_request":{"href":"https://api.github.com/repos/better1992/guestbook/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/better1992/guestbook/pulls/16","id":39451283,"html_url":"https://github.com/better1992/guestbook/pull/16","diff_url":"https://github.com/better1992/guestbook/pull/16.diff","patch_url":"https://github.com/better1992/guestbook/pull/16.patch","issue_url":"https://api.github.com/repos/better1992/guestbook/issues/16","number":16,"state":"open","locked":false,"title":"rebuild struct of app","user":{"login":"better1992","id":10934173,"avatar_url":"https://avatars.githubusercontent.com/u/10934173?v=3","gravatar_id":"","url":"https://api.github.com/users/better1992","html_url":"https://github.com/better1992","followers_url":"https://api.github.com/users/better1992/followers","following_url":"https://api.github.com/users/better1992/following{/other_user}","gists_url":"https://api.github.com/users/better1992/gists{/gist_id}","starred_url":"https://api.github.com/users/better1992/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/better1992/subscriptions","organizations_url":"https://api.github.com/users/better1992/orgs","repos_url":"https://api.github.com/users/better1992/repos","events_url":"https://api.github.com/users/better1992/events{/privacy}","received_events_url":"https://api.github.com/users/better1992/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-07-08T08:10:17Z","updated_at":"2015-07-14T04:28:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0a1e890035fb72a4f22305e153f1320fa9323ecd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/better1992/guestbook/pulls/16/commits","review_comments_url":"https://api.github.com/repos/better1992/guestbook/pulls/16/comments","review_comment_url":"https://api.github.com/repos/better1992/guestbook/pulls/comments{/number}","comments_url":"https://api.github.com/repos/better1992/guestbook/issues/16/comments","statuses_url":"https://api.github.com/repos/better1992/guestbook/statuses/fb7d220bbb7bb671e8feeb2b640816908920c7e7","head":{"label":"better1992:feature/advanced_guestbook_serverside","ref":"feature/advanced_guestbook_serverside","sha":"fb7d220bbb7bb671e8feeb2b640816908920c7e7","user":{"login":"better1992","id":10934173,"avatar_url":"https://avatars.githubusercontent.com/u/10934173?v=3","gravatar_id":"","url":"https://api.github.com/users/better1992","html_url":"https://github.com/better1992","followers_url":"https://api.github.com/users/better1992/followers","following_url":"https://api.github.com/users/better1992/following{/other_user}","gists_url":"https://api.github.com/users/better1992/gists{/gist_id}","starred_url":"https://api.github.com/users/better1992/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/better1992/subscriptions","organizations_url":"https://api.github.com/users/better1992/orgs","repos_url":"https://api.github.com/users/better1992/repos","events_url":"https://api.github.com/users/better1992/events{/privacy}","received_events_url":"https://api.github.com/users/better1992/received_events","type":"User","site_admin":false},"repo":{"id":30628196,"name":"guestbook","full_name":"better1992/guestbook","owner":{"login":"better1992","id":10934173,"avatar_url":"https://avatars.githubusercontent.com/u/10934173?v=3","gravatar_id":"","url":"https://api.github.com/users/better1992","html_url":"https://github.com/better1992","followers_url":"https://api.github.com/users/better1992/followers","following_url":"https://api.github.com/users/better1992/following{/other_user}","gists_url":"https://api.github.com/users/better1992/gists{/gist_id}","starred_url":"https://api.github.com/users/better1992/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/better1992/subscriptions","organizations_url":"https://api.github.com/users/better1992/orgs","repos_url":"https://api.github.com/users/better1992/repos","events_url":"https://api.github.com/users/better1992/events{/privacy}","received_events_url":"https://api.github.com/users/better1992/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/better1992/guestbook","description":"","fork":false,"url":"https://api.github.com/repos/better1992/guestbook","forks_url":"https://api.github.com/repos/better1992/guestbook/forks","keys_url":"https://api.github.com/repos/better1992/guestbook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/better1992/guestbook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/better1992/guestbook/teams","hooks_url":"https://api.github.com/repos/better1992/guestbook/hooks","issue_events_url":"https://api.github.com/repos/better1992/guestbook/issues/events{/number}","events_url":"https://api.github.com/repos/better1992/guestbook/events","assignees_url":"https://api.github.com/repos/better1992/guestbook/assignees{/user}","branches_url":"https://api.github.com/repos/better1992/guestbook/branches{/branch}","tags_url":"https://api.github.com/repos/better1992/guestbook/tags","blobs_url":"https://api.github.com/repos/better1992/guestbook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/better1992/guestbook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/better1992/guestbook/git/refs{/sha}","trees_url":"https://api.github.com/repos/better1992/guestbook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/better1992/guestbook/statuses/{sha}","languages_url":"https://api.github.com/repos/better1992/guestbook/languages","stargazers_url":"https://api.github.com/repos/better1992/guestbook/stargazers","contributors_url":"https://api.github.com/repos/better1992/guestbook/contributors","subscribers_url":"https://api.github.com/repos/better1992/guestbook/subscribers","subscription_url":"https://api.github.com/repos/better1992/guestbook/subscription","commits_url":"https://api.github.com/repos/better1992/guestbook/commits{/sha}","git_commits_url":"https://api.github.com/repos/better1992/guestbook/git/commits{/sha}","comments_url":"https://api.github.com/repos/better1992/guestbook/comments{/number}","issue_comment_url":"https://api.github.com/repos/better1992/guestbook/issues/comments{/number}","contents_url":"https://api.github.com/repos/better1992/guestbook/contents/{+path}","compare_url":"https://api.github.com/repos/better1992/guestbook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/better1992/guestbook/merges","archive_url":"https://api.github.com/repos/better1992/guestbook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/better1992/guestbook/downloads","issues_url":"https://api.github.com/repos/better1992/guestbook/issues{/number}","pulls_url":"https://api.github.com/repos/better1992/guestbook/pulls{/number}","milestones_url":"https://api.github.com/repos/better1992/guestbook/milestones{/number}","notifications_url":"https://api.github.com/repos/better1992/guestbook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/better1992/guestbook/labels{/name}","releases_url":"https://api.github.com/repos/better1992/guestbook/releases{/id}","created_at":"2015-02-11T03:16:07Z","updated_at":"2015-02-11T03:16:07Z","pushed_at":"2015-07-14T03:50:30Z","git_url":"git://github.com/better1992/guestbook.git","ssh_url":"git@github.com:better1992/guestbook.git","clone_url":"https://github.com/better1992/guestbook.git","svn_url":"https://github.com/better1992/guestbook","homepage":null,"size":644,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":9,"forks":0,"open_issues":9,"watchers":0,"default_branch":"master"}},"base":{"label":"better1992:develop","ref":"develop","sha":"e2145f33fa34fa327891ec7b843c5db367c4a5b0","user":{"login":"better1992","id":10934173,"avatar_url":"https://avatars.githubusercontent.com/u/10934173?v=3","gravatar_id":"","url":"https://api.github.com/users/better1992","html_url":"https://github.com/better1992","followers_url":"https://api.github.com/users/better1992/followers","following_url":"https://api.github.com/users/better1992/following{/other_user}","gists_url":"https://api.github.com/users/better1992/gists{/gist_id}","starred_url":"https://api.github.com/users/better1992/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/better1992/subscriptions","organizations_url":"https://api.github.com/users/better1992/orgs","repos_url":"https://api.github.com/users/better1992/repos","events_url":"https://api.github.com/users/better1992/events{/privacy}","received_events_url":"https://api.github.com/users/better1992/received_events","type":"User","site_admin":false},"repo":{"id":30628196,"name":"guestbook","full_name":"better1992/guestbook","owner":{"login":"better1992","id":10934173,"avatar_url":"https://avatars.githubusercontent.com/u/10934173?v=3","gravatar_id":"","url":"https://api.github.com/users/better1992","html_url":"https://github.com/better1992","followers_url":"https://api.github.com/users/better1992/followers","following_url":"https://api.github.com/users/better1992/following{/other_user}","gists_url":"https://api.github.com/users/better1992/gists{/gist_id}","starred_url":"https://api.github.com/users/better1992/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/better1992/subscriptions","organizations_url":"https://api.github.com/users/better1992/orgs","repos_url":"https://api.github.com/users/better1992/repos","events_url":"https://api.github.com/users/better1992/events{/privacy}","received_events_url":"https://api.github.com/users/better1992/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/better1992/guestbook","description":"","fork":false,"url":"https://api.github.com/repos/better1992/guestbook","forks_url":"https://api.github.com/repos/better1992/guestbook/forks","keys_url":"https://api.github.com/repos/better1992/guestbook/keys{/key_id}","collaborators_url":"https://api.github.com/repos/better1992/guestbook/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/better1992/guestbook/teams","hooks_url":"https://api.github.com/repos/better1992/guestbook/hooks","issue_events_url":"https://api.github.com/repos/better1992/guestbook/issues/events{/number}","events_url":"https://api.github.com/repos/better1992/guestbook/events","assignees_url":"https://api.github.com/repos/better1992/guestbook/assignees{/user}","branches_url":"https://api.github.com/repos/better1992/guestbook/branches{/branch}","tags_url":"https://api.github.com/repos/better1992/guestbook/tags","blobs_url":"https://api.github.com/repos/better1992/guestbook/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/better1992/guestbook/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/better1992/guestbook/git/refs{/sha}","trees_url":"https://api.github.com/repos/better1992/guestbook/git/trees{/sha}","statuses_url":"https://api.github.com/repos/better1992/guestbook/statuses/{sha}","languages_url":"https://api.github.com/repos/better1992/guestbook/languages","stargazers_url":"https://api.github.com/repos/better1992/guestbook/stargazers","contributors_url":"https://api.github.com/repos/better1992/guestbook/contributors","subscribers_url":"https://api.github.com/repos/better1992/guestbook/subscribers","subscription_url":"https://api.github.com/repos/better1992/guestbook/subscription","commits_url":"https://api.github.com/repos/better1992/guestbook/commits{/sha}","git_commits_url":"https://api.github.com/repos/better1992/guestbook/git/commits{/sha}","comments_url":"https://api.github.com/repos/better1992/guestbook/comments{/number}","issue_comment_url":"https://api.github.com/repos/better1992/guestbook/issues/comments{/number}","contents_url":"https://api.github.com/repos/better1992/guestbook/contents/{+path}","compare_url":"https://api.github.com/repos/better1992/guestbook/compare/{base}...{head}","merges_url":"https://api.github.com/repos/better1992/guestbook/merges","archive_url":"https://api.github.com/repos/better1992/guestbook/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/better1992/guestbook/downloads","issues_url":"https://api.github.com/repos/better1992/guestbook/issues{/number}","pulls_url":"https://api.github.com/repos/better1992/guestbook/pulls{/number}","milestones_url":"https://api.github.com/repos/better1992/guestbook/milestones{/number}","notifications_url":"https://api.github.com/repos/better1992/guestbook/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/better1992/guestbook/labels{/name}","releases_url":"https://api.github.com/repos/better1992/guestbook/releases{/id}","created_at":"2015-02-11T03:16:07Z","updated_at":"2015-02-11T03:16:07Z","pushed_at":"2015-07-14T03:50:30Z","git_url":"git://github.com/better1992/guestbook.git","ssh_url":"git@github.com:better1992/guestbook.git","clone_url":"https://github.com/better1992/guestbook.git","svn_url":"https://github.com/better1992/guestbook","homepage":null,"size":644,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":9,"forks":0,"open_issues":9,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/better1992/guestbook/pulls/16"},"html":{"href":"https://github.com/better1992/guestbook/pull/16"},"issue":{"href":"https://api.github.com/repos/better1992/guestbook/issues/16"},"comments":{"href":"https://api.github.com/repos/better1992/guestbook/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/better1992/guestbook/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/better1992/guestbook/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/better1992/guestbook/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/better1992/guestbook/statuses/fb7d220bbb7bb671e8feeb2b640816908920c7e7"}}}}