{"action":"created","comment":{"url":"https://api.github.com/repos/rajatguptarg/beacons/pulls/comments/48014870","id":48014870,"diff_hunk":"@@ -114,7 +116,55 @@ def edit_beacon_status():\n     else:\n         beacon_details = Beacon(request.form)\n         status = controller.modify_beacon(beacon_details, credentials)\n+\n         # TODO: Make proper status based upon respnse\n         return render_template(\n             'edit_beacon_status.jinja', status=status\n         )\n+\n+@portal.route('/namespace', methods=['GET'])\n+def beacon_namespace():\n+    if 'credentials' not in flask.session:\n+        return flask.redirect(flask.url_for('portal.oauth2callback'))\n+    credentials = client.OAuth2Credentials.from_json(\n+        flask.session['credentials']\n+    )\n+\n+    if credentials.access_token_expired:\n+        return flask.redirect(flask.url_for('portal.oauth2callback'))\n+    else:\n+        header = Header(credentials.access_token)\n+        response = requests.get(ATTACHMENT,\n+            headers=header.__str__())\n+\n+        return render_template(\n+            'namespace_status.jinja', status=json.loads(response.content)\n+        )\n+\n+@portal.route('/attachment')\n+def attachment_beacons():\n+    return render_template('attachment.jinja')\n+\n+\n+@portal.route('/attachment-status', methods=['POST'])\n+def beacon_attachment_status():\n+    if 'credentials' not in flask.session:\n+        return flask.redirect(flask.url_for('portal.oauth2callback'))\n+    credentials = client.OAuth2Credentials.from_json(\n+        flask.session['credentials']\n+    )\n+\n+    if credentials.access_token_expired:\n+        return flask.redirect(flask.url_for('portal.oauth2callback'))\n+    else:\n+        beacon = Beacon(request.form)\n+        status = controller.attachdatato_beacon(beacon,credentials)\n+        \n+        status1 = json.loads(status)\n+        for key, value in status1.iteritems():","path":"beacons/portal/view/views.py","position":91,"original_position":91,"commit_id":"1cc5934e4288b2659ec5f8bb49436f5de2dcddf4","original_commit_id":"1cc5934e4288b2659ec5f8bb49436f5de2dcddf4","user":{"login":"rajatguptarg","id":10649334,"avatar_url":"https://avatars.githubusercontent.com/u/10649334?v=3","gravatar_id":"","url":"https://api.github.com/users/rajatguptarg","html_url":"https://github.com/rajatguptarg","followers_url":"https://api.github.com/users/rajatguptarg/followers","following_url":"https://api.github.com/users/rajatguptarg/following{/other_user}","gists_url":"https://api.github.com/users/rajatguptarg/gists{/gist_id}","starred_url":"https://api.github.com/users/rajatguptarg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rajatguptarg/subscriptions","organizations_url":"https://api.github.com/users/rajatguptarg/orgs","repos_url":"https://api.github.com/users/rajatguptarg/repos","events_url":"https://api.github.com/users/rajatguptarg/events{/privacy}","received_events_url":"https://api.github.com/users/rajatguptarg/received_events","type":"User","site_admin":false},"body":"Direct pick the data. No need of loop","created_at":"2015-12-18T10:59:27Z","updated_at":"2015-12-18T10:59:27Z","html_url":"https://github.com/rajatguptarg/beacons/pull/7#discussion_r48014870","pull_request_url":"https://api.github.com/repos/rajatguptarg/beacons/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/rajatguptarg/beacons/pulls/comments/48014870"},"html":{"href":"https://github.com/rajatguptarg/beacons/pull/7#discussion_r48014870"},"pull_request":{"href":"https://api.github.com/repos/rajatguptarg/beacons/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/rajatguptarg/beacons/pulls/7","id":54088608,"html_url":"https://github.com/rajatguptarg/beacons/pull/7","diff_url":"https://github.com/rajatguptarg/beacons/pull/7.diff","patch_url":"https://github.com/rajatguptarg/beacons/pull/7.patch","issue_url":"https://api.github.com/repos/rajatguptarg/beacons/issues/7","number":7,"state":"open","locked":false,"title":"Develop","user":{"login":"ParulThoughtworks","id":15243286,"avatar_url":"https://avatars.githubusercontent.com/u/15243286?v=3","gravatar_id":"","url":"https://api.github.com/users/ParulThoughtworks","html_url":"https://github.com/ParulThoughtworks","followers_url":"https://api.github.com/users/ParulThoughtworks/followers","following_url":"https://api.github.com/users/ParulThoughtworks/following{/other_user}","gists_url":"https://api.github.com/users/ParulThoughtworks/gists{/gist_id}","starred_url":"https://api.github.com/users/ParulThoughtworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ParulThoughtworks/subscriptions","organizations_url":"https://api.github.com/users/ParulThoughtworks/orgs","repos_url":"https://api.github.com/users/ParulThoughtworks/repos","events_url":"https://api.github.com/users/ParulThoughtworks/events{/privacy}","received_events_url":"https://api.github.com/users/ParulThoughtworks/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-12-18T10:49:45Z","updated_at":"2015-12-18T10:59:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"569157d45b90dcfd122a961198d914e0e711ba17","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rajatguptarg/beacons/pulls/7/commits","review_comments_url":"https://api.github.com/repos/rajatguptarg/beacons/pulls/7/comments","review_comment_url":"https://api.github.com/repos/rajatguptarg/beacons/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rajatguptarg/beacons/issues/7/comments","statuses_url":"https://api.github.com/repos/rajatguptarg/beacons/statuses/1cc5934e4288b2659ec5f8bb49436f5de2dcddf4","head":{"label":"ParulThoughtworks:develop","ref":"develop","sha":"1cc5934e4288b2659ec5f8bb49436f5de2dcddf4","user":{"login":"ParulThoughtworks","id":15243286,"avatar_url":"https://avatars.githubusercontent.com/u/15243286?v=3","gravatar_id":"","url":"https://api.github.com/users/ParulThoughtworks","html_url":"https://github.com/ParulThoughtworks","followers_url":"https://api.github.com/users/ParulThoughtworks/followers","following_url":"https://api.github.com/users/ParulThoughtworks/following{/other_user}","gists_url":"https://api.github.com/users/ParulThoughtworks/gists{/gist_id}","starred_url":"https://api.github.com/users/ParulThoughtworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ParulThoughtworks/subscriptions","organizations_url":"https://api.github.com/users/ParulThoughtworks/orgs","repos_url":"https://api.github.com/users/ParulThoughtworks/repos","events_url":"https://api.github.com/users/ParulThoughtworks/events{/privacy}","received_events_url":"https://api.github.com/users/ParulThoughtworks/received_events","type":"User","site_admin":false},"repo":{"id":47974402,"name":"beacons","full_name":"ParulThoughtworks/beacons","owner":{"login":"ParulThoughtworks","id":15243286,"avatar_url":"https://avatars.githubusercontent.com/u/15243286?v=3","gravatar_id":"","url":"https://api.github.com/users/ParulThoughtworks","html_url":"https://github.com/ParulThoughtworks","followers_url":"https://api.github.com/users/ParulThoughtworks/followers","following_url":"https://api.github.com/users/ParulThoughtworks/following{/other_user}","gists_url":"https://api.github.com/users/ParulThoughtworks/gists{/gist_id}","starred_url":"https://api.github.com/users/ParulThoughtworks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ParulThoughtworks/subscriptions","organizations_url":"https://api.github.com/users/ParulThoughtworks/orgs","repos_url":"https://api.github.com/users/ParulThoughtworks/repos","events_url":"https://api.github.com/users/ParulThoughtworks/events{/privacy}","received_events_url":"https://api.github.com/users/ParulThoughtworks/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ParulThoughtworks/beacons","description":"Beacon SetUp Portal","fork":true,"url":"https://api.github.com/repos/ParulThoughtworks/beacons","forks_url":"https://api.github.com/repos/ParulThoughtworks/beacons/forks","keys_url":"https://api.github.com/repos/ParulThoughtworks/beacons/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ParulThoughtworks/beacons/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ParulThoughtworks/beacons/teams","hooks_url":"https://api.github.com/repos/ParulThoughtworks/beacons/hooks","issue_events_url":"https://api.github.com/repos/ParulThoughtworks/beacons/issues/events{/number}","events_url":"https://api.github.com/repos/ParulThoughtworks/beacons/events","assignees_url":"https://api.github.com/repos/ParulThoughtworks/beacons/assignees{/user}","branches_url":"https://api.github.com/repos/ParulThoughtworks/beacons/branches{/branch}","tags_url":"https://api.github.com/repos/ParulThoughtworks/beacons/tags","blobs_url":"https://api.github.com/repos/ParulThoughtworks/beacons/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ParulThoughtworks/beacons/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ParulThoughtworks/beacons/git/refs{/sha}","trees_url":"https://api.github.com/repos/ParulThoughtworks/beacons/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ParulThoughtworks/beacons/statuses/{sha}","languages_url":"https://api.github.com/repos/ParulThoughtworks/beacons/languages","stargazers_url":"https://api.github.com/repos/ParulThoughtworks/beacons/stargazers","contributors_url":"https://api.github.com/repos/ParulThoughtworks/beacons/contributors","subscribers_url":"https://api.github.com/repos/ParulThoughtworks/beacons/subscribers","subscription_url":"https://api.github.com/repos/ParulThoughtworks/beacons/subscription","commits_url":"https://api.github.com/repos/ParulThoughtworks/beacons/commits{/sha}","git_commits_url":"https://api.github.com/repos/ParulThoughtworks/beacons/git/commits{/sha}","comments_url":"https://api.github.com/repos/ParulThoughtworks/beacons/comments{/number}","issue_comment_url":"https://api.github.com/repos/ParulThoughtworks/beacons/issues/comments{/number}","contents_url":"https://api.github.com/repos/ParulThoughtworks/beacons/contents/{+path}","compare_url":"https://api.github.com/repos/ParulThoughtworks/beacons/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ParulThoughtworks/beacons/merges","archive_url":"https://api.github.com/repos/ParulThoughtworks/beacons/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ParulThoughtworks/beacons/downloads","issues_url":"https://api.github.com/repos/ParulThoughtworks/beacons/issues{/number}","pulls_url":"https://api.github.com/repos/ParulThoughtworks/beacons/pulls{/number}","milestones_url":"https://api.github.com/repos/ParulThoughtworks/beacons/milestones{/number}","notifications_url":"https://api.github.com/repos/ParulThoughtworks/beacons/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ParulThoughtworks/beacons/labels{/name}","releases_url":"https://api.github.com/repos/ParulThoughtworks/beacons/releases{/id}","created_at":"2015-12-14T12:41:32Z","updated_at":"2015-12-14T12:41:33Z","pushed_at":"2015-12-18T10:33:52Z","git_url":"git://github.com/ParulThoughtworks/beacons.git","ssh_url":"git@github.com:ParulThoughtworks/beacons.git","clone_url":"https://github.com/ParulThoughtworks/beacons.git","svn_url":"https://github.com/ParulThoughtworks/beacons","homepage":null,"size":69,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"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":"rajatguptarg:develop","ref":"develop","sha":"4dc17811f429e965ff265f764218aae479d5a45f","user":{"login":"rajatguptarg","id":10649334,"avatar_url":"https://avatars.githubusercontent.com/u/10649334?v=3","gravatar_id":"","url":"https://api.github.com/users/rajatguptarg","html_url":"https://github.com/rajatguptarg","followers_url":"https://api.github.com/users/rajatguptarg/followers","following_url":"https://api.github.com/users/rajatguptarg/following{/other_user}","gists_url":"https://api.github.com/users/rajatguptarg/gists{/gist_id}","starred_url":"https://api.github.com/users/rajatguptarg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rajatguptarg/subscriptions","organizations_url":"https://api.github.com/users/rajatguptarg/orgs","repos_url":"https://api.github.com/users/rajatguptarg/repos","events_url":"https://api.github.com/users/rajatguptarg/events{/privacy}","received_events_url":"https://api.github.com/users/rajatguptarg/received_events","type":"User","site_admin":false},"repo":{"id":47549594,"name":"beacons","full_name":"rajatguptarg/beacons","owner":{"login":"rajatguptarg","id":10649334,"avatar_url":"https://avatars.githubusercontent.com/u/10649334?v=3","gravatar_id":"","url":"https://api.github.com/users/rajatguptarg","html_url":"https://github.com/rajatguptarg","followers_url":"https://api.github.com/users/rajatguptarg/followers","following_url":"https://api.github.com/users/rajatguptarg/following{/other_user}","gists_url":"https://api.github.com/users/rajatguptarg/gists{/gist_id}","starred_url":"https://api.github.com/users/rajatguptarg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rajatguptarg/subscriptions","organizations_url":"https://api.github.com/users/rajatguptarg/orgs","repos_url":"https://api.github.com/users/rajatguptarg/repos","events_url":"https://api.github.com/users/rajatguptarg/events{/privacy}","received_events_url":"https://api.github.com/users/rajatguptarg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rajatguptarg/beacons","description":"Beacon SetUp Portal","fork":false,"url":"https://api.github.com/repos/rajatguptarg/beacons","forks_url":"https://api.github.com/repos/rajatguptarg/beacons/forks","keys_url":"https://api.github.com/repos/rajatguptarg/beacons/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rajatguptarg/beacons/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rajatguptarg/beacons/teams","hooks_url":"https://api.github.com/repos/rajatguptarg/beacons/hooks","issue_events_url":"https://api.github.com/repos/rajatguptarg/beacons/issues/events{/number}","events_url":"https://api.github.com/repos/rajatguptarg/beacons/events","assignees_url":"https://api.github.com/repos/rajatguptarg/beacons/assignees{/user}","branches_url":"https://api.github.com/repos/rajatguptarg/beacons/branches{/branch}","tags_url":"https://api.github.com/repos/rajatguptarg/beacons/tags","blobs_url":"https://api.github.com/repos/rajatguptarg/beacons/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rajatguptarg/beacons/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rajatguptarg/beacons/git/refs{/sha}","trees_url":"https://api.github.com/repos/rajatguptarg/beacons/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rajatguptarg/beacons/statuses/{sha}","languages_url":"https://api.github.com/repos/rajatguptarg/beacons/languages","stargazers_url":"https://api.github.com/repos/rajatguptarg/beacons/stargazers","contributors_url":"https://api.github.com/repos/rajatguptarg/beacons/contributors","subscribers_url":"https://api.github.com/repos/rajatguptarg/beacons/subscribers","subscription_url":"https://api.github.com/repos/rajatguptarg/beacons/subscription","commits_url":"https://api.github.com/repos/rajatguptarg/beacons/commits{/sha}","git_commits_url":"https://api.github.com/repos/rajatguptarg/beacons/git/commits{/sha}","comments_url":"https://api.github.com/repos/rajatguptarg/beacons/comments{/number}","issue_comment_url":"https://api.github.com/repos/rajatguptarg/beacons/issues/comments{/number}","contents_url":"https://api.github.com/repos/rajatguptarg/beacons/contents/{+path}","compare_url":"https://api.github.com/repos/rajatguptarg/beacons/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rajatguptarg/beacons/merges","archive_url":"https://api.github.com/repos/rajatguptarg/beacons/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rajatguptarg/beacons/downloads","issues_url":"https://api.github.com/repos/rajatguptarg/beacons/issues{/number}","pulls_url":"https://api.github.com/repos/rajatguptarg/beacons/pulls{/number}","milestones_url":"https://api.github.com/repos/rajatguptarg/beacons/milestones{/number}","notifications_url":"https://api.github.com/repos/rajatguptarg/beacons/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rajatguptarg/beacons/labels{/name}","releases_url":"https://api.github.com/repos/rajatguptarg/beacons/releases{/id}","created_at":"2015-12-07T12:01:55Z","updated_at":"2015-12-08T11:40:55Z","pushed_at":"2015-12-18T10:49:45Z","git_url":"git://github.com/rajatguptarg/beacons.git","ssh_url":"git@github.com:rajatguptarg/beacons.git","clone_url":"https://github.com/rajatguptarg/beacons.git","svn_url":"https://github.com/rajatguptarg/beacons","homepage":null,"size":59,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rajatguptarg/beacons/pulls/7"},"html":{"href":"https://github.com/rajatguptarg/beacons/pull/7"},"issue":{"href":"https://api.github.com/repos/rajatguptarg/beacons/issues/7"},"comments":{"href":"https://api.github.com/repos/rajatguptarg/beacons/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/rajatguptarg/beacons/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/rajatguptarg/beacons/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rajatguptarg/beacons/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/rajatguptarg/beacons/statuses/1cc5934e4288b2659ec5f8bb49436f5de2dcddf4"}}}}