{"action":"created","comment":{"url":"https://api.github.com/repos/wso2/carbon-apimgt/pulls/comments/112397883","pull_request_review_id":33707933,"id":112397883,"diff_hunk":"@@ -210,6 +211,16 @@ public Response applicationsApplicationIdPut(String applicationId, ApplicationDT\n             }\n \n             Application application = ApplicationMappingUtil.fromDTOtoApplication(body, username);\n+            if (!ApplicationStatus.APPLICATION_APPROVED.equals(application.getStatus())) {\n+                String errorMessage = \"Application \" + applicationId + \" is not active\";\n+                ExceptionCodes exceptionCode = ExceptionCodes.APPLICATION_INACTIVE;\n+                APIManagementException e = new APIManagementException(errorMessage, exceptionCode);\n+                HashMap<String, String> paramList = new HashMap<String, String>();\n+                ErrorDTO errorDTO = RestApiUtil.getErrorDTO(e.getErrorHandler(), paramList);","path":"components/apimgt/org.wso2.carbon.apimgt.rest.api.store/src/main/java/org/wso2/carbon/apimgt/rest/api/store/impl/ApplicationsApiServiceImpl.java","position":17,"original_position":17,"commit_id":"738b5d33e9b6c654235e14b941f26f208b9a6fb5","original_commit_id":"ae48592bb43ef80f0361a2e28e4629d275f76a6a","user":{"login":"fazlan-nazeem","id":13759167,"avatar_url":"https://avatars1.githubusercontent.com/u/13759167?v=3","gravatar_id":"","url":"https://api.github.com/users/fazlan-nazeem","html_url":"https://github.com/fazlan-nazeem","followers_url":"https://api.github.com/users/fazlan-nazeem/followers","following_url":"https://api.github.com/users/fazlan-nazeem/following{/other_user}","gists_url":"https://api.github.com/users/fazlan-nazeem/gists{/gist_id}","starred_url":"https://api.github.com/users/fazlan-nazeem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fazlan-nazeem/subscriptions","organizations_url":"https://api.github.com/users/fazlan-nazeem/orgs","repos_url":"https://api.github.com/users/fazlan-nazeem/repos","events_url":"https://api.github.com/users/fazlan-nazeem/events{/privacy}","received_events_url":"https://api.github.com/users/fazlan-nazeem/received_events","type":"User","site_admin":false},"body":"an empty paramList is passed. We can add the application id to the paramList I guess.","created_at":"2017-04-20T08:46:32Z","updated_at":"2017-04-20T08:47:52Z","html_url":"https://github.com/wso2/carbon-apimgt/pull/3958#discussion_r112397883","pull_request_url":"https://api.github.com/repos/wso2/carbon-apimgt/pulls/3958","_links":{"self":{"href":"https://api.github.com/repos/wso2/carbon-apimgt/pulls/comments/112397883"},"html":{"href":"https://github.com/wso2/carbon-apimgt/pull/3958#discussion_r112397883"},"pull_request":{"href":"https://api.github.com/repos/wso2/carbon-apimgt/pulls/3958"}}},"pull_request":{"url":"https://api.github.com/repos/wso2/carbon-apimgt/pulls/3958","id":116715979,"html_url":"https://github.com/wso2/carbon-apimgt/pull/3958","diff_url":"https://github.com/wso2/carbon-apimgt/pull/3958.diff","patch_url":"https://github.com/wso2/carbon-apimgt/pull/3958.patch","issue_url":"https://api.github.com/repos/wso2/carbon-apimgt/issues/3958","number":3958,"state":"open","locked":false,"title":"block app edit and token generation for inactive application","user":{"login":"chamilaadhi","id":4861150,"avatar_url":"https://avatars1.githubusercontent.com/u/4861150?v=3","gravatar_id":"","url":"https://api.github.com/users/chamilaadhi","html_url":"https://github.com/chamilaadhi","followers_url":"https://api.github.com/users/chamilaadhi/followers","following_url":"https://api.github.com/users/chamilaadhi/following{/other_user}","gists_url":"https://api.github.com/users/chamilaadhi/gists{/gist_id}","starred_url":"https://api.github.com/users/chamilaadhi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chamilaadhi/subscriptions","organizations_url":"https://api.github.com/users/chamilaadhi/orgs","repos_url":"https://api.github.com/users/chamilaadhi/repos","events_url":"https://api.github.com/users/chamilaadhi/events{/privacy}","received_events_url":"https://api.github.com/users/chamilaadhi/received_events","type":"User","site_admin":false},"body":"### Proposed changes in this pull request\r\n\r\n[List all changes you want to add here. If you fixed an issue, please\r\nadd a reference to that issue as well.]\r\n\r\n- block token generation and app edit for inactive apps from rest api\r\n- disable token generation and app edit for inactive/rejected apps from UI\r\n### When should this PR be merged\r\n\r\n[Please describe any preconditions that need to be addressed before we\r\ncan merge this pull request.]\r\n\r\n\r\n### Follow up actions\r\n\r\n[List any possible follow-up actions here; for instance, testing data\r\nmigrations, software that we need to install on staging and production\r\nenvironments.]\r\n\r\n-\r\n\r\n\r\n### Checklist (for reviewing)\r\n\r\n#### General\r\n\r\n- [ ] **Is this PR explained thoroughly?** All code changes must be accounted for in the PR description.\r\n- [ ] **Is the PR labeled correctly?\r\n\r\n#### Functionality\r\n\r\n- [ ] **Are all requirements met?** Compare implemented functionality with the requirements specification.\r\n- [ ] **Does the UI work as expected?** There should be no Javascript errors in the console; all resources should load. There should be no unexpected errors. Deliberately try to break the feature to find out if there are corner cases that are not handled.\r\n\r\n#### Code\r\n\r\n- [ ] **Do you fully understand the introduced changes to the code?** If not ask for clarification, it might uncover ways to solve a problem in a more elegant and efficient way.\r\n- [ ] **Does the PR introduce any inefficient database requests?** Use the debug server to check for duplicate requests.\r\n- [ ] **Are all necessary strings marked for translation?** All strings that are exposed to users via the UI must be [marked for translation](https://docs.djangoproject.com/en/1.10/topics/i18n/translation/).\r\n\r\n#### Tests\r\n\r\n- [ ] **Are there sufficient test cases?** Ensure that all components are tested individually; models, forms, and serializers should be tested in isolation even if a test for a view covers these components.\r\n- [ ] **If this is a bug fix, are tests for the issue in place?**  There must be a test case for the bug to ensure the issue won’t regress. Make sure that the tests break without the new code to fix the issue.\r\n- [ ] **If this is a new feature or a significant change to an existing feature?** has the manual testing spreadsheet been updated with instructions for manual testing?\r\n\r\n#### Security\r\n\r\n- [ ] ** Confirm this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.**\r\n- [ ] ** Are all UI and API inputs run through forms or serializers?**\r\n- [ ] ** Are all external inputs validated and sanitized appropriately?**\r\n- [ ] ** Does all branching logic have a default case?**\r\n- [ ] ** Does this solution handle outliers and edge cases gracefully?**\r\n- [ ] ** Are all external communications secured and restricted to SSL?**\r\n\r\n#### Documentation\r\n\r\n- [ ] **Are changes to the UI documented in the platform docs?** If this PR introduces new platform site functionality or changes existing ones, the changes should be documented.\r\n- [ ] **Are changes to the API documented in the API docs?** If this PR introduces new API functionality or changes existing ones, the changes must be documented.\r\n- [ ] **Are reusable components documented?** If this PR introduces components that are relevant to other developers (for instance a mixin for a view or a generic form) they should be documented in the Wiki.\r\n","created_at":"2017-04-20T08:27:04Z","updated_at":"2017-04-20T08:47:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"281ed2f9d4fe40a9a3e3aef901f0aa946f8cda0e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/wso2/carbon-apimgt/pulls/3958/commits","review_comments_url":"https://api.github.com/repos/wso2/carbon-apimgt/pulls/3958/comments","review_comment_url":"https://api.github.com/repos/wso2/carbon-apimgt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wso2/carbon-apimgt/issues/3958/comments","statuses_url":"https://api.github.com/repos/wso2/carbon-apimgt/statuses/738b5d33e9b6c654235e14b941f26f208b9a6fb5","head":{"label":"chamilaadhi:C5","ref":"C5","sha":"738b5d33e9b6c654235e14b941f26f208b9a6fb5","user":{"login":"chamilaadhi","id":4861150,"avatar_url":"https://avatars1.githubusercontent.com/u/4861150?v=3","gravatar_id":"","url":"https://api.github.com/users/chamilaadhi","html_url":"https://github.com/chamilaadhi","followers_url":"https://api.github.com/users/chamilaadhi/followers","following_url":"https://api.github.com/users/chamilaadhi/following{/other_user}","gists_url":"https://api.github.com/users/chamilaadhi/gists{/gist_id}","starred_url":"https://api.github.com/users/chamilaadhi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chamilaadhi/subscriptions","organizations_url":"https://api.github.com/users/chamilaadhi/orgs","repos_url":"https://api.github.com/users/chamilaadhi/repos","events_url":"https://api.github.com/users/chamilaadhi/events{/privacy}","received_events_url":"https://api.github.com/users/chamilaadhi/received_events","type":"User","site_admin":false},"repo":{"id":43906003,"name":"carbon-apimgt","full_name":"chamilaadhi/carbon-apimgt","owner":{"login":"chamilaadhi","id":4861150,"avatar_url":"https://avatars1.githubusercontent.com/u/4861150?v=3","gravatar_id":"","url":"https://api.github.com/users/chamilaadhi","html_url":"https://github.com/chamilaadhi","followers_url":"https://api.github.com/users/chamilaadhi/followers","following_url":"https://api.github.com/users/chamilaadhi/following{/other_user}","gists_url":"https://api.github.com/users/chamilaadhi/gists{/gist_id}","starred_url":"https://api.github.com/users/chamilaadhi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chamilaadhi/subscriptions","organizations_url":"https://api.github.com/users/chamilaadhi/orgs","repos_url":"https://api.github.com/users/chamilaadhi/repos","events_url":"https://api.github.com/users/chamilaadhi/events{/privacy}","received_events_url":"https://api.github.com/users/chamilaadhi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chamilaadhi/carbon-apimgt","description":null,"fork":true,"url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt","forks_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/forks","keys_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/teams","hooks_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/hooks","issue_events_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/issues/events{/number}","events_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/events","assignees_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/assignees{/user}","branches_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/branches{/branch}","tags_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/tags","blobs_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/git/refs{/sha}","trees_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/statuses/{sha}","languages_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/languages","stargazers_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/stargazers","contributors_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/contributors","subscribers_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/subscribers","subscription_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/subscription","commits_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/commits{/sha}","git_commits_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/git/commits{/sha}","comments_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/comments{/number}","issue_comment_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/issues/comments{/number}","contents_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/contents/{+path}","compare_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/merges","archive_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/downloads","issues_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/issues{/number}","pulls_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/pulls{/number}","milestones_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/milestones{/number}","notifications_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/labels{/name}","releases_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/releases{/id}","deployments_url":"https://api.github.com/repos/chamilaadhi/carbon-apimgt/deployments","created_at":"2015-10-08T17:36:31Z","updated_at":"2016-01-11T03:29:29Z","pushed_at":"2017-04-20T08:46:49Z","git_url":"git://github.com/chamilaadhi/carbon-apimgt.git","ssh_url":"git@github.com:chamilaadhi/carbon-apimgt.git","clone_url":"https://github.com/chamilaadhi/carbon-apimgt.git","svn_url":"https://github.com/chamilaadhi/carbon-apimgt","homepage":null,"size":174485,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"wso2:C5","ref":"C5","sha":"9e8279e2ecc681c1a6c926f1162b9335c457dfd8","user":{"login":"wso2","id":533043,"avatar_url":"https://avatars0.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"repo":{"id":17201744,"name":"carbon-apimgt","full_name":"wso2/carbon-apimgt","owner":{"login":"wso2","id":533043,"avatar_url":"https://avatars0.githubusercontent.com/u/533043?v=3","gravatar_id":"","url":"https://api.github.com/users/wso2","html_url":"https://github.com/wso2","followers_url":"https://api.github.com/users/wso2/followers","following_url":"https://api.github.com/users/wso2/following{/other_user}","gists_url":"https://api.github.com/users/wso2/gists{/gist_id}","starred_url":"https://api.github.com/users/wso2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wso2/subscriptions","organizations_url":"https://api.github.com/users/wso2/orgs","repos_url":"https://api.github.com/users/wso2/repos","events_url":"https://api.github.com/users/wso2/events{/privacy}","received_events_url":"https://api.github.com/users/wso2/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wso2/carbon-apimgt","description":null,"fork":false,"url":"https://api.github.com/repos/wso2/carbon-apimgt","forks_url":"https://api.github.com/repos/wso2/carbon-apimgt/forks","keys_url":"https://api.github.com/repos/wso2/carbon-apimgt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wso2/carbon-apimgt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wso2/carbon-apimgt/teams","hooks_url":"https://api.github.com/repos/wso2/carbon-apimgt/hooks","issue_events_url":"https://api.github.com/repos/wso2/carbon-apimgt/issues/events{/number}","events_url":"https://api.github.com/repos/wso2/carbon-apimgt/events","assignees_url":"https://api.github.com/repos/wso2/carbon-apimgt/assignees{/user}","branches_url":"https://api.github.com/repos/wso2/carbon-apimgt/branches{/branch}","tags_url":"https://api.github.com/repos/wso2/carbon-apimgt/tags","blobs_url":"https://api.github.com/repos/wso2/carbon-apimgt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wso2/carbon-apimgt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wso2/carbon-apimgt/git/refs{/sha}","trees_url":"https://api.github.com/repos/wso2/carbon-apimgt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wso2/carbon-apimgt/statuses/{sha}","languages_url":"https://api.github.com/repos/wso2/carbon-apimgt/languages","stargazers_url":"https://api.github.com/repos/wso2/carbon-apimgt/stargazers","contributors_url":"https://api.github.com/repos/wso2/carbon-apimgt/contributors","subscribers_url":"https://api.github.com/repos/wso2/carbon-apimgt/subscribers","subscription_url":"https://api.github.com/repos/wso2/carbon-apimgt/subscription","commits_url":"https://api.github.com/repos/wso2/carbon-apimgt/commits{/sha}","git_commits_url":"https://api.github.com/repos/wso2/carbon-apimgt/git/commits{/sha}","comments_url":"https://api.github.com/repos/wso2/carbon-apimgt/comments{/number}","issue_comment_url":"https://api.github.com/repos/wso2/carbon-apimgt/issues/comments{/number}","contents_url":"https://api.github.com/repos/wso2/carbon-apimgt/contents/{+path}","compare_url":"https://api.github.com/repos/wso2/carbon-apimgt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wso2/carbon-apimgt/merges","archive_url":"https://api.github.com/repos/wso2/carbon-apimgt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wso2/carbon-apimgt/downloads","issues_url":"https://api.github.com/repos/wso2/carbon-apimgt/issues{/number}","pulls_url":"https://api.github.com/repos/wso2/carbon-apimgt/pulls{/number}","milestones_url":"https://api.github.com/repos/wso2/carbon-apimgt/milestones{/number}","notifications_url":"https://api.github.com/repos/wso2/carbon-apimgt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wso2/carbon-apimgt/labels{/name}","releases_url":"https://api.github.com/repos/wso2/carbon-apimgt/releases{/id}","deployments_url":"https://api.github.com/repos/wso2/carbon-apimgt/deployments","created_at":"2014-02-26T06:46:48Z","updated_at":"2017-04-20T05:58:28Z","pushed_at":"2017-04-20T08:46:50Z","git_url":"git://github.com/wso2/carbon-apimgt.git","ssh_url":"git@github.com:wso2/carbon-apimgt.git","clone_url":"https://github.com/wso2/carbon-apimgt.git","svn_url":"https://github.com/wso2/carbon-apimgt","homepage":null,"size":175243,"stargazers_count":24,"watchers_count":24,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":234,"mirror_url":null,"open_issues_count":23,"forks":234,"open_issues":23,"watchers":24,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wso2/carbon-apimgt/pulls/3958"},"html":{"href":"https://github.com/wso2/carbon-apimgt/pull/3958"},"issue":{"href":"https://api.github.com/repos/wso2/carbon-apimgt/issues/3958"},"comments":{"href":"https://api.github.com/repos/wso2/carbon-apimgt/issues/3958/comments"},"review_comments":{"href":"https://api.github.com/repos/wso2/carbon-apimgt/pulls/3958/comments"},"review_comment":{"href":"https://api.github.com/repos/wso2/carbon-apimgt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wso2/carbon-apimgt/pulls/3958/commits"},"statuses":{"href":"https://api.github.com/repos/wso2/carbon-apimgt/statuses/738b5d33e9b6c654235e14b941f26f208b9a6fb5"}}}}
{"actor":{"display_login":"fazlan-nazeem"}}