{"action":"created","comment":{"url":"https://api.github.com/repos/go-gitea/gitea/pulls/comments/211103627","pull_request_review_id":147459415,"id":211103627,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMTEwMzYyNw==","diff_hunk":"@@ -103,9 +103,29 @@ func SubmitReview(ctx *context.Context, form auth.SubmitReviewForm) {\n \tvar err error\n \n \treviewType := form.ReviewType()\n-\tif reviewType == models.ReviewTypeUnknown {\n+\n+\tswitch reviewType {\n+\tcase models.ReviewTypeUnknown:\n \t\tctx.ServerError(\"GetCurrentReview\", fmt.Errorf(\"unknown ReviewType: %s\", form.Type))\n \t\treturn\n+\n+\t// can not approve/reject your own PR\n+\tcase models.ReviewTypeApprove, models.ReviewTypeReject:\n+\n+\t\tif issue.Poster.ID == ctx.User.ID {\n+\n+\t\t\tvar translated string\n+\n+\t\t\tif reviewType == models.ReviewTypeApprove {\n+\t\t\t\ttranslated = ctx.Tr(\"repo.issues.review.self.approval\")\n+\t\t\t} else {\n+\t\t\t\ttranslated = ctx.Tr(\"repo.issues.review.self.rejection\")\n+\t\t\t}\n+\n+\t\t\tctx.Flash.Error(translated)\n+\t\t\tctx.Redirect(fmt.Sprintf(\"%s/pulls/%d\", ctx.Repo.RepoLink, issue.Index))","path":"routers/repo/pull_review.go","position":25,"original_position":25,"commit_id":"3b019d86989d35b8cba44af14e52de2dae0dc7eb","original_commit_id":"3b019d86989d35b8cba44af14e52de2dae0dc7eb","user":{"login":"adelowo","id":12677701,"node_id":"MDQ6VXNlcjEyNjc3NzAx","avatar_url":"https://avatars3.githubusercontent.com/u/12677701?v=4","gravatar_id":"","url":"https://api.github.com/users/adelowo","html_url":"https://github.com/adelowo","followers_url":"https://api.github.com/users/adelowo/followers","following_url":"https://api.github.com/users/adelowo/following{/other_user}","gists_url":"https://api.github.com/users/adelowo/gists{/gist_id}","starred_url":"https://api.github.com/users/adelowo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adelowo/subscriptions","organizations_url":"https://api.github.com/users/adelowo/orgs","repos_url":"https://api.github.com/users/adelowo/repos","events_url":"https://api.github.com/users/adelowo/events{/privacy}","received_events_url":"https://api.github.com/users/adelowo/received_events","type":"User","site_admin":false},"body":"The `base/alert` template isn't imported in the template for the page `%s/pulls/%d/files` which is why I redirected back to the main page... Should I just add the alert template in there or just leave it as it is ? ( #4632  redirects to the main PR page though )","created_at":"2018-08-19T13:43:02Z","updated_at":"2018-08-19T13:43:02Z","html_url":"https://github.com/go-gitea/gitea/pull/4729#discussion_r211103627","pull_request_url":"https://api.github.com/repos/go-gitea/gitea/pulls/4729","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/go-gitea/gitea/pulls/comments/211103627"},"html":{"href":"https://github.com/go-gitea/gitea/pull/4729#discussion_r211103627"},"pull_request":{"href":"https://api.github.com/repos/go-gitea/gitea/pulls/4729"}},"in_reply_to_id":211076753},"pull_request":{"url":"https://api.github.com/repos/go-gitea/gitea/pulls/4729","id":208854129,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA4ODU0MTI5","html_url":"https://github.com/go-gitea/gitea/pull/4729","diff_url":"https://github.com/go-gitea/gitea/pull/4729.diff","patch_url":"https://github.com/go-gitea/gitea/pull/4729.patch","issue_url":"https://api.github.com/repos/go-gitea/gitea/issues/4729","number":4729,"state":"open","locked":false,"title":"User shouldn't be able to approve or reject his/her own PR","user":{"login":"adelowo","id":12677701,"node_id":"MDQ6VXNlcjEyNjc3NzAx","avatar_url":"https://avatars3.githubusercontent.com/u/12677701?v=4","gravatar_id":"","url":"https://api.github.com/users/adelowo","html_url":"https://github.com/adelowo","followers_url":"https://api.github.com/users/adelowo/followers","following_url":"https://api.github.com/users/adelowo/following{/other_user}","gists_url":"https://api.github.com/users/adelowo/gists{/gist_id}","starred_url":"https://api.github.com/users/adelowo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adelowo/subscriptions","organizations_url":"https://api.github.com/users/adelowo/orgs","repos_url":"https://api.github.com/users/adelowo/repos","events_url":"https://api.github.com/users/adelowo/events{/privacy}","received_events_url":"https://api.github.com/users/adelowo/received_events","type":"User","site_admin":false},"body":"Fixes #4728","created_at":"2018-08-16T13:10:44Z","updated_at":"2018-08-19T13:43:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7d85a3c0c2420542b34ce906948b9ffe306c0721","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":472744938,"node_id":"MDU6TGFiZWw0NzI3NDQ5Mzg=","url":"https://api.github.com/repos/go-gitea/gitea/labels/kind/bug","name":"kind/bug","color":"ee0701","default":false},{"id":475283583,"node_id":"MDU6TGFiZWw0NzUyODM1ODM=","url":"https://api.github.com/repos/go-gitea/gitea/labels/lgtm/need%202","name":"lgtm/need 2","color":"d93f0b","default":false}],"milestone":{"url":"https://api.github.com/repos/go-gitea/gitea/milestones/24","html_url":"https://github.com/go-gitea/gitea/milestone/24","labels_url":"https://api.github.com/repos/go-gitea/gitea/milestones/24/labels","id":3338092,"node_id":"MDk6TWlsZXN0b25lMzMzODA5Mg==","number":24,"title":"1.6.0","description":"","creator":{"login":"lunny","id":81045,"node_id":"MDQ6VXNlcjgxMDQ1","avatar_url":"https://avatars2.githubusercontent.com/u/81045?v=4","gravatar_id":"","url":"https://api.github.com/users/lunny","html_url":"https://github.com/lunny","followers_url":"https://api.github.com/users/lunny/followers","following_url":"https://api.github.com/users/lunny/following{/other_user}","gists_url":"https://api.github.com/users/lunny/gists{/gist_id}","starred_url":"https://api.github.com/users/lunny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lunny/subscriptions","organizations_url":"https://api.github.com/users/lunny/orgs","repos_url":"https://api.github.com/users/lunny/repos","events_url":"https://api.github.com/users/lunny/events{/privacy}","received_events_url":"https://api.github.com/users/lunny/received_events","type":"User","site_admin":false},"open_issues":78,"closed_issues":114,"state":"open","created_at":"2018-05-11T05:37:01Z","updated_at":"2018-08-19T13:27:17Z","due_on":"2018-09-01T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/go-gitea/gitea/pulls/4729/commits","review_comments_url":"https://api.github.com/repos/go-gitea/gitea/pulls/4729/comments","review_comment_url":"https://api.github.com/repos/go-gitea/gitea/pulls/comments{/number}","comments_url":"https://api.github.com/repos/go-gitea/gitea/issues/4729/comments","statuses_url":"https://api.github.com/repos/go-gitea/gitea/statuses/3b019d86989d35b8cba44af14e52de2dae0dc7eb","head":{"label":"adelowo:cannot_approve_or_reject_your_own_pr","ref":"cannot_approve_or_reject_your_own_pr","sha":"3b019d86989d35b8cba44af14e52de2dae0dc7eb","user":{"login":"adelowo","id":12677701,"node_id":"MDQ6VXNlcjEyNjc3NzAx","avatar_url":"https://avatars3.githubusercontent.com/u/12677701?v=4","gravatar_id":"","url":"https://api.github.com/users/adelowo","html_url":"https://github.com/adelowo","followers_url":"https://api.github.com/users/adelowo/followers","following_url":"https://api.github.com/users/adelowo/following{/other_user}","gists_url":"https://api.github.com/users/adelowo/gists{/gist_id}","starred_url":"https://api.github.com/users/adelowo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adelowo/subscriptions","organizations_url":"https://api.github.com/users/adelowo/orgs","repos_url":"https://api.github.com/users/adelowo/repos","events_url":"https://api.github.com/users/adelowo/events{/privacy}","received_events_url":"https://api.github.com/users/adelowo/received_events","type":"User","site_admin":false},"repo":{"id":101417003,"node_id":"MDEwOlJlcG9zaXRvcnkxMDE0MTcwMDM=","name":"gitea","full_name":"adelowo/gitea","owner":{"login":"adelowo","id":12677701,"node_id":"MDQ6VXNlcjEyNjc3NzAx","avatar_url":"https://avatars3.githubusercontent.com/u/12677701?v=4","gravatar_id":"","url":"https://api.github.com/users/adelowo","html_url":"https://github.com/adelowo","followers_url":"https://api.github.com/users/adelowo/followers","following_url":"https://api.github.com/users/adelowo/following{/other_user}","gists_url":"https://api.github.com/users/adelowo/gists{/gist_id}","starred_url":"https://api.github.com/users/adelowo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adelowo/subscriptions","organizations_url":"https://api.github.com/users/adelowo/orgs","repos_url":"https://api.github.com/users/adelowo/repos","events_url":"https://api.github.com/users/adelowo/events{/privacy}","received_events_url":"https://api.github.com/users/adelowo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/adelowo/gitea","description":"Gitea: Git with a cup of tea","fork":true,"url":"https://api.github.com/repos/adelowo/gitea","forks_url":"https://api.github.com/repos/adelowo/gitea/forks","keys_url":"https://api.github.com/repos/adelowo/gitea/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adelowo/gitea/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adelowo/gitea/teams","hooks_url":"https://api.github.com/repos/adelowo/gitea/hooks","issue_events_url":"https://api.github.com/repos/adelowo/gitea/issues/events{/number}","events_url":"https://api.github.com/repos/adelowo/gitea/events","assignees_url":"https://api.github.com/repos/adelowo/gitea/assignees{/user}","branches_url":"https://api.github.com/repos/adelowo/gitea/branches{/branch}","tags_url":"https://api.github.com/repos/adelowo/gitea/tags","blobs_url":"https://api.github.com/repos/adelowo/gitea/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adelowo/gitea/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adelowo/gitea/git/refs{/sha}","trees_url":"https://api.github.com/repos/adelowo/gitea/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adelowo/gitea/statuses/{sha}","languages_url":"https://api.github.com/repos/adelowo/gitea/languages","stargazers_url":"https://api.github.com/repos/adelowo/gitea/stargazers","contributors_url":"https://api.github.com/repos/adelowo/gitea/contributors","subscribers_url":"https://api.github.com/repos/adelowo/gitea/subscribers","subscription_url":"https://api.github.com/repos/adelowo/gitea/subscription","commits_url":"https://api.github.com/repos/adelowo/gitea/commits{/sha}","git_commits_url":"https://api.github.com/repos/adelowo/gitea/git/commits{/sha}","comments_url":"https://api.github.com/repos/adelowo/gitea/comments{/number}","issue_comment_url":"https://api.github.com/repos/adelowo/gitea/issues/comments{/number}","contents_url":"https://api.github.com/repos/adelowo/gitea/contents/{+path}","compare_url":"https://api.github.com/repos/adelowo/gitea/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adelowo/gitea/merges","archive_url":"https://api.github.com/repos/adelowo/gitea/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adelowo/gitea/downloads","issues_url":"https://api.github.com/repos/adelowo/gitea/issues{/number}","pulls_url":"https://api.github.com/repos/adelowo/gitea/pulls{/number}","milestones_url":"https://api.github.com/repos/adelowo/gitea/milestones{/number}","notifications_url":"https://api.github.com/repos/adelowo/gitea/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adelowo/gitea/labels{/name}","releases_url":"https://api.github.com/repos/adelowo/gitea/releases{/id}","deployments_url":"https://api.github.com/repos/adelowo/gitea/deployments","created_at":"2017-08-25T15:25:41Z","updated_at":"2018-08-15T15:22:33Z","pushed_at":"2018-08-19T13:22:06Z","git_url":"git://github.com/adelowo/gitea.git","ssh_url":"git@github.com:adelowo/gitea.git","clone_url":"https://github.com/adelowo/gitea.git","svn_url":"https://github.com/adelowo/gitea","homepage":"http://gitea.io","size":118026,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"go-gitea:master","ref":"master","sha":"b1ad5734c69025a85e3ed618576fc0160de9ce22","user":{"login":"go-gitea","id":12724356,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNzI0MzU2","avatar_url":"https://avatars1.githubusercontent.com/u/12724356?v=4","gravatar_id":"","url":"https://api.github.com/users/go-gitea","html_url":"https://github.com/go-gitea","followers_url":"https://api.github.com/users/go-gitea/followers","following_url":"https://api.github.com/users/go-gitea/following{/other_user}","gists_url":"https://api.github.com/users/go-gitea/gists{/gist_id}","starred_url":"https://api.github.com/users/go-gitea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/go-gitea/subscriptions","organizations_url":"https://api.github.com/users/go-gitea/orgs","repos_url":"https://api.github.com/users/go-gitea/repos","events_url":"https://api.github.com/users/go-gitea/events{/privacy}","received_events_url":"https://api.github.com/users/go-gitea/received_events","type":"Organization","site_admin":false},"repo":{"id":72495579,"node_id":"MDEwOlJlcG9zaXRvcnk3MjQ5NTU3OQ==","name":"gitea","full_name":"go-gitea/gitea","owner":{"login":"go-gitea","id":12724356,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNzI0MzU2","avatar_url":"https://avatars1.githubusercontent.com/u/12724356?v=4","gravatar_id":"","url":"https://api.github.com/users/go-gitea","html_url":"https://github.com/go-gitea","followers_url":"https://api.github.com/users/go-gitea/followers","following_url":"https://api.github.com/users/go-gitea/following{/other_user}","gists_url":"https://api.github.com/users/go-gitea/gists{/gist_id}","starred_url":"https://api.github.com/users/go-gitea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/go-gitea/subscriptions","organizations_url":"https://api.github.com/users/go-gitea/orgs","repos_url":"https://api.github.com/users/go-gitea/repos","events_url":"https://api.github.com/users/go-gitea/events{/privacy}","received_events_url":"https://api.github.com/users/go-gitea/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/go-gitea/gitea","description":"Git with a cup of tea, painless self-hosted git service","fork":false,"url":"https://api.github.com/repos/go-gitea/gitea","forks_url":"https://api.github.com/repos/go-gitea/gitea/forks","keys_url":"https://api.github.com/repos/go-gitea/gitea/keys{/key_id}","collaborators_url":"https://api.github.com/repos/go-gitea/gitea/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/go-gitea/gitea/teams","hooks_url":"https://api.github.com/repos/go-gitea/gitea/hooks","issue_events_url":"https://api.github.com/repos/go-gitea/gitea/issues/events{/number}","events_url":"https://api.github.com/repos/go-gitea/gitea/events","assignees_url":"https://api.github.com/repos/go-gitea/gitea/assignees{/user}","branches_url":"https://api.github.com/repos/go-gitea/gitea/branches{/branch}","tags_url":"https://api.github.com/repos/go-gitea/gitea/tags","blobs_url":"https://api.github.com/repos/go-gitea/gitea/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/go-gitea/gitea/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/go-gitea/gitea/git/refs{/sha}","trees_url":"https://api.github.com/repos/go-gitea/gitea/git/trees{/sha}","statuses_url":"https://api.github.com/repos/go-gitea/gitea/statuses/{sha}","languages_url":"https://api.github.com/repos/go-gitea/gitea/languages","stargazers_url":"https://api.github.com/repos/go-gitea/gitea/stargazers","contributors_url":"https://api.github.com/repos/go-gitea/gitea/contributors","subscribers_url":"https://api.github.com/repos/go-gitea/gitea/subscribers","subscription_url":"https://api.github.com/repos/go-gitea/gitea/subscription","commits_url":"https://api.github.com/repos/go-gitea/gitea/commits{/sha}","git_commits_url":"https://api.github.com/repos/go-gitea/gitea/git/commits{/sha}","comments_url":"https://api.github.com/repos/go-gitea/gitea/comments{/number}","issue_comment_url":"https://api.github.com/repos/go-gitea/gitea/issues/comments{/number}","contents_url":"https://api.github.com/repos/go-gitea/gitea/contents/{+path}","compare_url":"https://api.github.com/repos/go-gitea/gitea/compare/{base}...{head}","merges_url":"https://api.github.com/repos/go-gitea/gitea/merges","archive_url":"https://api.github.com/repos/go-gitea/gitea/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/go-gitea/gitea/downloads","issues_url":"https://api.github.com/repos/go-gitea/gitea/issues{/number}","pulls_url":"https://api.github.com/repos/go-gitea/gitea/pulls{/number}","milestones_url":"https://api.github.com/repos/go-gitea/gitea/milestones{/number}","notifications_url":"https://api.github.com/repos/go-gitea/gitea/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/go-gitea/gitea/labels{/name}","releases_url":"https://api.github.com/repos/go-gitea/gitea/releases{/id}","deployments_url":"https://api.github.com/repos/go-gitea/gitea/deployments","created_at":"2016-11-01T02:13:26Z","updated_at":"2018-08-19T12:21:29Z","pushed_at":"2018-08-18T07:03:45Z","git_url":"git://github.com/go-gitea/gitea.git","ssh_url":"git@github.com:go-gitea/gitea.git","clone_url":"https://github.com/go-gitea/gitea.git","svn_url":"https://github.com/go-gitea/gitea","homepage":"https://gitea.io","size":118266,"stargazers_count":9549,"watchers_count":9549,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":926,"mirror_url":null,"archived":false,"open_issues_count":965,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":926,"open_issues":965,"watchers":9549,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/go-gitea/gitea/pulls/4729"},"html":{"href":"https://github.com/go-gitea/gitea/pull/4729"},"issue":{"href":"https://api.github.com/repos/go-gitea/gitea/issues/4729"},"comments":{"href":"https://api.github.com/repos/go-gitea/gitea/issues/4729/comments"},"review_comments":{"href":"https://api.github.com/repos/go-gitea/gitea/pulls/4729/comments"},"review_comment":{"href":"https://api.github.com/repos/go-gitea/gitea/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/go-gitea/gitea/pulls/4729/commits"},"statuses":{"href":"https://api.github.com/repos/go-gitea/gitea/statuses/3b019d86989d35b8cba44af14e52de2dae0dc7eb"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"adelowo"}}