{"action":"created","comment":{"url":"https://api.github.com/repos/nus-ncl/service-web/pulls/comments/92553665","pull_request_review_id":13070810,"id":92553665,"diff_hunk":"@@ -2177,13 +2179,19 @@ public String startExperiment(\n \n         // ensure experiment is stopped first before starting\n         Realization realization = invokeAndExtractRealization(teamName, Long.parseLong(expId));\n+        String teamStatus = getTeamStatus(realization.getTeamId());\n \n         if (!checkPermissionRealizeExperiment(realization, session)) {\n             log.warn(\"Permission denied to start experiment: {} for team: {}\", realization.getExperimentName(), teamName);\n             redirectAttributes.addFlashAttribute(MESSAGE, permissionDeniedMessage);\n             return \"redirect:/experiments\";\n         }\n \n+        if (!teamStatus.equals(TeamStatus.APPROVED.name())) {\n+            log.warn(\"Error: trying to realize an experiment {} on team {} with status {}\", realization.getExperimentName(), realization.getId(), teamStatus);\n+            redirectAttributes.addFlashAttribute(MESSAGE, \"Team \" + teamName + \" is currently \" + teamStatus + \" and does not have permission to start experiment \" + realization.getExperimentName() + \" Please contact \" + CONTACT_EMAIL);","path":"src/main/java/sg/ncl/MainController.java","position":81,"original_position":81,"commit_id":"397cf726d67a0d8150c8b3a5ccd25d3f0fdffa4e","original_commit_id":"397cf726d67a0d8150c8b3a5ccd25d3f0fdffa4e","user":{"login":"ChrisZhong","id":1946052,"avatar_url":"https://avatars.githubusercontent.com/u/1946052?v=3","gravatar_id":"","url":"https://api.github.com/users/ChrisZhong","html_url":"https://github.com/ChrisZhong","followers_url":"https://api.github.com/users/ChrisZhong/followers","following_url":"https://api.github.com/users/ChrisZhong/following{/other_user}","gists_url":"https://api.github.com/users/ChrisZhong/gists{/gist_id}","starred_url":"https://api.github.com/users/ChrisZhong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChrisZhong/subscriptions","organizations_url":"https://api.github.com/users/ChrisZhong/orgs","repos_url":"https://api.github.com/users/ChrisZhong/repos","events_url":"https://api.github.com/users/ChrisZhong/events{/privacy}","received_events_url":"https://api.github.com/users/ChrisZhong/received_events","type":"User","site_admin":false},"body":"![CRITICAL](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/severity-critical.png) Define a constant instead of duplicating this literal \"Team \" 3 times. [![rule](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/rule.png)](https://sonarqube.com/coding_rules#rule_key=squid%3AS1192)\n","created_at":"2016-12-15T06:58:50Z","updated_at":"2016-12-15T06:58:50Z","html_url":"https://github.com/nus-ncl/service-web/pull/153#discussion_r92553665","pull_request_url":"https://api.github.com/repos/nus-ncl/service-web/pulls/153","_links":{"self":{"href":"https://api.github.com/repos/nus-ncl/service-web/pulls/comments/92553665"},"html":{"href":"https://github.com/nus-ncl/service-web/pull/153#discussion_r92553665"},"pull_request":{"href":"https://api.github.com/repos/nus-ncl/service-web/pulls/153"}}},"pull_request":{"url":"https://api.github.com/repos/nus-ncl/service-web/pulls/153","id":97882805,"html_url":"https://github.com/nus-ncl/service-web/pull/153","diff_url":"https://github.com/nus-ncl/service-web/pull/153.diff","patch_url":"https://github.com/nus-ncl/service-web/pull/153.patch","issue_url":"https://api.github.com/repos/nus-ncl/service-web/issues/153","number":153,"state":"open","locked":false,"title":"DEV-854 implement suspend team on web-service","user":{"login":"teye","id":6906654,"avatar_url":"https://avatars.githubusercontent.com/u/6906654?v=3","gravatar_id":"","url":"https://api.github.com/users/teye","html_url":"https://github.com/teye","followers_url":"https://api.github.com/users/teye/followers","following_url":"https://api.github.com/users/teye/following{/other_user}","gists_url":"https://api.github.com/users/teye/gists{/gist_id}","starred_url":"https://api.github.com/users/teye/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teye/subscriptions","organizations_url":"https://api.github.com/users/teye/orgs","repos_url":"https://api.github.com/users/teye/repos","events_url":"https://api.github.com/users/teye/events{/privacy}","received_events_url":"https://api.github.com/users/teye/received_events","type":"User","site_admin":false},"body":null,"created_at":"2016-12-14T03:50:52Z","updated_at":"2016-12-15T06:58:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7e46967a9e14d1e8df539ccdfc5441cf38ba43b7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/nus-ncl/service-web/pulls/153/commits","review_comments_url":"https://api.github.com/repos/nus-ncl/service-web/pulls/153/comments","review_comment_url":"https://api.github.com/repos/nus-ncl/service-web/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nus-ncl/service-web/issues/153/comments","statuses_url":"https://api.github.com/repos/nus-ncl/service-web/statuses/397cf726d67a0d8150c8b3a5ccd25d3f0fdffa4e","head":{"label":"nus-ncl:DEV-854","ref":"DEV-854","sha":"397cf726d67a0d8150c8b3a5ccd25d3f0fdffa4e","user":{"login":"nus-ncl","id":15359055,"avatar_url":"https://avatars.githubusercontent.com/u/15359055?v=3","gravatar_id":"","url":"https://api.github.com/users/nus-ncl","html_url":"https://github.com/nus-ncl","followers_url":"https://api.github.com/users/nus-ncl/followers","following_url":"https://api.github.com/users/nus-ncl/following{/other_user}","gists_url":"https://api.github.com/users/nus-ncl/gists{/gist_id}","starred_url":"https://api.github.com/users/nus-ncl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nus-ncl/subscriptions","organizations_url":"https://api.github.com/users/nus-ncl/orgs","repos_url":"https://api.github.com/users/nus-ncl/repos","events_url":"https://api.github.com/users/nus-ncl/events{/privacy}","received_events_url":"https://api.github.com/users/nus-ncl/received_events","type":"Organization","site_admin":false},"repo":{"id":54450246,"name":"service-web","full_name":"nus-ncl/service-web","owner":{"login":"nus-ncl","id":15359055,"avatar_url":"https://avatars.githubusercontent.com/u/15359055?v=3","gravatar_id":"","url":"https://api.github.com/users/nus-ncl","html_url":"https://github.com/nus-ncl","followers_url":"https://api.github.com/users/nus-ncl/followers","following_url":"https://api.github.com/users/nus-ncl/following{/other_user}","gists_url":"https://api.github.com/users/nus-ncl/gists{/gist_id}","starred_url":"https://api.github.com/users/nus-ncl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nus-ncl/subscriptions","organizations_url":"https://api.github.com/users/nus-ncl/orgs","repos_url":"https://api.github.com/users/nus-ncl/repos","events_url":"https://api.github.com/users/nus-ncl/events{/privacy}","received_events_url":"https://api.github.com/users/nus-ncl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nus-ncl/service-web","description":"Development of official NCL UI","fork":false,"url":"https://api.github.com/repos/nus-ncl/service-web","forks_url":"https://api.github.com/repos/nus-ncl/service-web/forks","keys_url":"https://api.github.com/repos/nus-ncl/service-web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nus-ncl/service-web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nus-ncl/service-web/teams","hooks_url":"https://api.github.com/repos/nus-ncl/service-web/hooks","issue_events_url":"https://api.github.com/repos/nus-ncl/service-web/issues/events{/number}","events_url":"https://api.github.com/repos/nus-ncl/service-web/events","assignees_url":"https://api.github.com/repos/nus-ncl/service-web/assignees{/user}","branches_url":"https://api.github.com/repos/nus-ncl/service-web/branches{/branch}","tags_url":"https://api.github.com/repos/nus-ncl/service-web/tags","blobs_url":"https://api.github.com/repos/nus-ncl/service-web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nus-ncl/service-web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nus-ncl/service-web/git/refs{/sha}","trees_url":"https://api.github.com/repos/nus-ncl/service-web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nus-ncl/service-web/statuses/{sha}","languages_url":"https://api.github.com/repos/nus-ncl/service-web/languages","stargazers_url":"https://api.github.com/repos/nus-ncl/service-web/stargazers","contributors_url":"https://api.github.com/repos/nus-ncl/service-web/contributors","subscribers_url":"https://api.github.com/repos/nus-ncl/service-web/subscribers","subscription_url":"https://api.github.com/repos/nus-ncl/service-web/subscription","commits_url":"https://api.github.com/repos/nus-ncl/service-web/commits{/sha}","git_commits_url":"https://api.github.com/repos/nus-ncl/service-web/git/commits{/sha}","comments_url":"https://api.github.com/repos/nus-ncl/service-web/comments{/number}","issue_comment_url":"https://api.github.com/repos/nus-ncl/service-web/issues/comments{/number}","contents_url":"https://api.github.com/repos/nus-ncl/service-web/contents/{+path}","compare_url":"https://api.github.com/repos/nus-ncl/service-web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nus-ncl/service-web/merges","archive_url":"https://api.github.com/repos/nus-ncl/service-web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nus-ncl/service-web/downloads","issues_url":"https://api.github.com/repos/nus-ncl/service-web/issues{/number}","pulls_url":"https://api.github.com/repos/nus-ncl/service-web/pulls{/number}","milestones_url":"https://api.github.com/repos/nus-ncl/service-web/milestones{/number}","notifications_url":"https://api.github.com/repos/nus-ncl/service-web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nus-ncl/service-web/labels{/name}","releases_url":"https://api.github.com/repos/nus-ncl/service-web/releases{/id}","deployments_url":"https://api.github.com/repos/nus-ncl/service-web/deployments","created_at":"2016-03-22T06:15:58Z","updated_at":"2016-10-24T07:12:44Z","pushed_at":"2016-12-15T06:56:41Z","git_url":"git://github.com/nus-ncl/service-web.git","ssh_url":"git@github.com:nus-ncl/service-web.git","clone_url":"https://github.com/nus-ncl/service-web.git","svn_url":"https://github.com/nus-ncl/service-web","homepage":null,"size":31051,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":0,"default_branch":"master"}},"base":{"label":"nus-ncl:master","ref":"master","sha":"ac6ce4c33612bb52f7d55730bd5619a76c7677c0","user":{"login":"nus-ncl","id":15359055,"avatar_url":"https://avatars.githubusercontent.com/u/15359055?v=3","gravatar_id":"","url":"https://api.github.com/users/nus-ncl","html_url":"https://github.com/nus-ncl","followers_url":"https://api.github.com/users/nus-ncl/followers","following_url":"https://api.github.com/users/nus-ncl/following{/other_user}","gists_url":"https://api.github.com/users/nus-ncl/gists{/gist_id}","starred_url":"https://api.github.com/users/nus-ncl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nus-ncl/subscriptions","organizations_url":"https://api.github.com/users/nus-ncl/orgs","repos_url":"https://api.github.com/users/nus-ncl/repos","events_url":"https://api.github.com/users/nus-ncl/events{/privacy}","received_events_url":"https://api.github.com/users/nus-ncl/received_events","type":"Organization","site_admin":false},"repo":{"id":54450246,"name":"service-web","full_name":"nus-ncl/service-web","owner":{"login":"nus-ncl","id":15359055,"avatar_url":"https://avatars.githubusercontent.com/u/15359055?v=3","gravatar_id":"","url":"https://api.github.com/users/nus-ncl","html_url":"https://github.com/nus-ncl","followers_url":"https://api.github.com/users/nus-ncl/followers","following_url":"https://api.github.com/users/nus-ncl/following{/other_user}","gists_url":"https://api.github.com/users/nus-ncl/gists{/gist_id}","starred_url":"https://api.github.com/users/nus-ncl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nus-ncl/subscriptions","organizations_url":"https://api.github.com/users/nus-ncl/orgs","repos_url":"https://api.github.com/users/nus-ncl/repos","events_url":"https://api.github.com/users/nus-ncl/events{/privacy}","received_events_url":"https://api.github.com/users/nus-ncl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nus-ncl/service-web","description":"Development of official NCL UI","fork":false,"url":"https://api.github.com/repos/nus-ncl/service-web","forks_url":"https://api.github.com/repos/nus-ncl/service-web/forks","keys_url":"https://api.github.com/repos/nus-ncl/service-web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nus-ncl/service-web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nus-ncl/service-web/teams","hooks_url":"https://api.github.com/repos/nus-ncl/service-web/hooks","issue_events_url":"https://api.github.com/repos/nus-ncl/service-web/issues/events{/number}","events_url":"https://api.github.com/repos/nus-ncl/service-web/events","assignees_url":"https://api.github.com/repos/nus-ncl/service-web/assignees{/user}","branches_url":"https://api.github.com/repos/nus-ncl/service-web/branches{/branch}","tags_url":"https://api.github.com/repos/nus-ncl/service-web/tags","blobs_url":"https://api.github.com/repos/nus-ncl/service-web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nus-ncl/service-web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nus-ncl/service-web/git/refs{/sha}","trees_url":"https://api.github.com/repos/nus-ncl/service-web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nus-ncl/service-web/statuses/{sha}","languages_url":"https://api.github.com/repos/nus-ncl/service-web/languages","stargazers_url":"https://api.github.com/repos/nus-ncl/service-web/stargazers","contributors_url":"https://api.github.com/repos/nus-ncl/service-web/contributors","subscribers_url":"https://api.github.com/repos/nus-ncl/service-web/subscribers","subscription_url":"https://api.github.com/repos/nus-ncl/service-web/subscription","commits_url":"https://api.github.com/repos/nus-ncl/service-web/commits{/sha}","git_commits_url":"https://api.github.com/repos/nus-ncl/service-web/git/commits{/sha}","comments_url":"https://api.github.com/repos/nus-ncl/service-web/comments{/number}","issue_comment_url":"https://api.github.com/repos/nus-ncl/service-web/issues/comments{/number}","contents_url":"https://api.github.com/repos/nus-ncl/service-web/contents/{+path}","compare_url":"https://api.github.com/repos/nus-ncl/service-web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nus-ncl/service-web/merges","archive_url":"https://api.github.com/repos/nus-ncl/service-web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nus-ncl/service-web/downloads","issues_url":"https://api.github.com/repos/nus-ncl/service-web/issues{/number}","pulls_url":"https://api.github.com/repos/nus-ncl/service-web/pulls{/number}","milestones_url":"https://api.github.com/repos/nus-ncl/service-web/milestones{/number}","notifications_url":"https://api.github.com/repos/nus-ncl/service-web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nus-ncl/service-web/labels{/name}","releases_url":"https://api.github.com/repos/nus-ncl/service-web/releases{/id}","deployments_url":"https://api.github.com/repos/nus-ncl/service-web/deployments","created_at":"2016-03-22T06:15:58Z","updated_at":"2016-10-24T07:12:44Z","pushed_at":"2016-12-15T06:56:41Z","git_url":"git://github.com/nus-ncl/service-web.git","ssh_url":"git@github.com:nus-ncl/service-web.git","clone_url":"https://github.com/nus-ncl/service-web.git","svn_url":"https://github.com/nus-ncl/service-web","homepage":null,"size":31051,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nus-ncl/service-web/pulls/153"},"html":{"href":"https://github.com/nus-ncl/service-web/pull/153"},"issue":{"href":"https://api.github.com/repos/nus-ncl/service-web/issues/153"},"comments":{"href":"https://api.github.com/repos/nus-ncl/service-web/issues/153/comments"},"review_comments":{"href":"https://api.github.com/repos/nus-ncl/service-web/pulls/153/comments"},"review_comment":{"href":"https://api.github.com/repos/nus-ncl/service-web/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nus-ncl/service-web/pulls/153/commits"},"statuses":{"href":"https://api.github.com/repos/nus-ncl/service-web/statuses/397cf726d67a0d8150c8b3a5ccd25d3f0fdffa4e"}}}}
{"actor":{"display_login":"ChrisZhong"}}