{"action":"created","comment":{"url":"https://api.github.com/repos/diging/mbl-browser/pulls/comments/186221020","pull_request_review_id":117762511,"id":186221020,"diff_hunk":"@@ -657,22 +656,46 @@ def add_investigator_record(request, person_id):\n     template = \"browser/investigator.html\"\n     form = InvestigatorForm()\n \n+    context = {\n+        'form': form,\n+        'person': person,\n+        'type': 'create_investigator'\n+    }\n+\n     if request.method == 'POST':\n         form = InvestigatorForm(request.POST, instance=person)\n         if form.is_valid():\n+            context.update({\n+                'form': form\n+            })\n+            if form.cleaned_data.get('institution_search'):\n+                if not form.cleaned_data.get('institution_id'):\n+                    # Check if the checkbox is checked\n+                    if form.cleaned_data.get('create_institution'):\n+                        institution = Institution.objects.create(\n+                            name=form.cleaned_data.get('institution_search'),\n+                            changed_by=request.user\n+                        )\n+                        form.cleaned_data[\"institution_id\"] = institution.id\n+                    else:\n+                        messages.add_message(request, messages.ERROR,\n+                                             'The above institute does not exist in the database. '\n+                                             'Please check the checkbox below to create '\n+                                             'information about the institute.')\n+                        return render(request, template, context)","path":"browser/views.py","position":38,"original_position":38,"commit_id":"7d2561969ec57d154430b93e03052bcd7d33094e","original_commit_id":"7d2561969ec57d154430b93e03052bcd7d33094e","user":{"login":"jdamerow","id":8881141,"avatar_url":"https://avatars2.githubusercontent.com/u/8881141?v=4","gravatar_id":"","url":"https://api.github.com/users/jdamerow","html_url":"https://github.com/jdamerow","followers_url":"https://api.github.com/users/jdamerow/followers","following_url":"https://api.github.com/users/jdamerow/following{/other_user}","gists_url":"https://api.github.com/users/jdamerow/gists{/gist_id}","starred_url":"https://api.github.com/users/jdamerow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdamerow/subscriptions","organizations_url":"https://api.github.com/users/jdamerow/orgs","repos_url":"https://api.github.com/users/jdamerow/repos","events_url":"https://api.github.com/users/jdamerow/events{/privacy}","received_events_url":"https://api.github.com/users/jdamerow/received_events","type":"User","site_admin":false},"body":"add the form to the context here, not in line 668 (you don't need it in the other cases, do you?).","created_at":"2018-05-04T21:02:44Z","updated_at":"2018-05-04T21:07:21Z","html_url":"https://github.com/diging/mbl-browser/pull/9#discussion_r186221020","pull_request_url":"https://api.github.com/repos/diging/mbl-browser/pulls/9","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/diging/mbl-browser/pulls/comments/186221020"},"html":{"href":"https://github.com/diging/mbl-browser/pull/9#discussion_r186221020"},"pull_request":{"href":"https://api.github.com/repos/diging/mbl-browser/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/diging/mbl-browser/pulls/9","id":164961382,"html_url":"https://github.com/diging/mbl-browser/pull/9","diff_url":"https://github.com/diging/mbl-browser/pull/9.diff","patch_url":"https://github.com/diging/mbl-browser/pull/9.patch","issue_url":"https://api.github.com/repos/diging/mbl-browser/issues/9","number":9,"state":"open","locked":false,"title":"[MHDP-8] added institute field into investigator form","user":{"login":"prnvshrn","id":20481066,"avatar_url":"https://avatars2.githubusercontent.com/u/20481066?v=4","gravatar_id":"","url":"https://api.github.com/users/prnvshrn","html_url":"https://github.com/prnvshrn","followers_url":"https://api.github.com/users/prnvshrn/followers","following_url":"https://api.github.com/users/prnvshrn/following{/other_user}","gists_url":"https://api.github.com/users/prnvshrn/gists{/gist_id}","starred_url":"https://api.github.com/users/prnvshrn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prnvshrn/subscriptions","organizations_url":"https://api.github.com/users/prnvshrn/orgs","repos_url":"https://api.github.com/users/prnvshrn/repos","events_url":"https://api.github.com/users/prnvshrn/events{/privacy}","received_events_url":"https://api.github.com/users/prnvshrn/received_events","type":"User","site_admin":false},"body":"- Added a institute field in investigator form , which also functions like an autocomplete suggestion box\r\n- Also added institute to the information displayed in the Research tab","created_at":"2018-01-24T21:01:03Z","updated_at":"2018-05-04T21:07:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1cf3dae4cd798fe6acf46159d8f0d00a27c4f2f9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/diging/mbl-browser/pulls/9/commits","review_comments_url":"https://api.github.com/repos/diging/mbl-browser/pulls/9/comments","review_comment_url":"https://api.github.com/repos/diging/mbl-browser/pulls/comments{/number}","comments_url":"https://api.github.com/repos/diging/mbl-browser/issues/9/comments","statuses_url":"https://api.github.com/repos/diging/mbl-browser/statuses/7d2561969ec57d154430b93e03052bcd7d33094e","head":{"label":"diging:task/MHDP-8","ref":"task/MHDP-8","sha":"7d2561969ec57d154430b93e03052bcd7d33094e","user":{"login":"diging","id":5402168,"avatar_url":"https://avatars2.githubusercontent.com/u/5402168?v=4","gravatar_id":"","url":"https://api.github.com/users/diging","html_url":"https://github.com/diging","followers_url":"https://api.github.com/users/diging/followers","following_url":"https://api.github.com/users/diging/following{/other_user}","gists_url":"https://api.github.com/users/diging/gists{/gist_id}","starred_url":"https://api.github.com/users/diging/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diging/subscriptions","organizations_url":"https://api.github.com/users/diging/orgs","repos_url":"https://api.github.com/users/diging/repos","events_url":"https://api.github.com/users/diging/events{/privacy}","received_events_url":"https://api.github.com/users/diging/received_events","type":"Organization","site_admin":false},"repo":{"id":41938360,"name":"mbl-browser","full_name":"diging/mbl-browser","owner":{"login":"diging","id":5402168,"avatar_url":"https://avatars2.githubusercontent.com/u/5402168?v=4","gravatar_id":"","url":"https://api.github.com/users/diging","html_url":"https://github.com/diging","followers_url":"https://api.github.com/users/diging/followers","following_url":"https://api.github.com/users/diging/following{/other_user}","gists_url":"https://api.github.com/users/diging/gists{/gist_id}","starred_url":"https://api.github.com/users/diging/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diging/subscriptions","organizations_url":"https://api.github.com/users/diging/orgs","repos_url":"https://api.github.com/users/diging/repos","events_url":"https://api.github.com/users/diging/events{/privacy}","received_events_url":"https://api.github.com/users/diging/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/diging/mbl-browser","description":"Curation platform and API for the MBL course and investigator dataset","fork":false,"url":"https://api.github.com/repos/diging/mbl-browser","forks_url":"https://api.github.com/repos/diging/mbl-browser/forks","keys_url":"https://api.github.com/repos/diging/mbl-browser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diging/mbl-browser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diging/mbl-browser/teams","hooks_url":"https://api.github.com/repos/diging/mbl-browser/hooks","issue_events_url":"https://api.github.com/repos/diging/mbl-browser/issues/events{/number}","events_url":"https://api.github.com/repos/diging/mbl-browser/events","assignees_url":"https://api.github.com/repos/diging/mbl-browser/assignees{/user}","branches_url":"https://api.github.com/repos/diging/mbl-browser/branches{/branch}","tags_url":"https://api.github.com/repos/diging/mbl-browser/tags","blobs_url":"https://api.github.com/repos/diging/mbl-browser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diging/mbl-browser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diging/mbl-browser/git/refs{/sha}","trees_url":"https://api.github.com/repos/diging/mbl-browser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diging/mbl-browser/statuses/{sha}","languages_url":"https://api.github.com/repos/diging/mbl-browser/languages","stargazers_url":"https://api.github.com/repos/diging/mbl-browser/stargazers","contributors_url":"https://api.github.com/repos/diging/mbl-browser/contributors","subscribers_url":"https://api.github.com/repos/diging/mbl-browser/subscribers","subscription_url":"https://api.github.com/repos/diging/mbl-browser/subscription","commits_url":"https://api.github.com/repos/diging/mbl-browser/commits{/sha}","git_commits_url":"https://api.github.com/repos/diging/mbl-browser/git/commits{/sha}","comments_url":"https://api.github.com/repos/diging/mbl-browser/comments{/number}","issue_comment_url":"https://api.github.com/repos/diging/mbl-browser/issues/comments{/number}","contents_url":"https://api.github.com/repos/diging/mbl-browser/contents/{+path}","compare_url":"https://api.github.com/repos/diging/mbl-browser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diging/mbl-browser/merges","archive_url":"https://api.github.com/repos/diging/mbl-browser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diging/mbl-browser/downloads","issues_url":"https://api.github.com/repos/diging/mbl-browser/issues{/number}","pulls_url":"https://api.github.com/repos/diging/mbl-browser/pulls{/number}","milestones_url":"https://api.github.com/repos/diging/mbl-browser/milestones{/number}","notifications_url":"https://api.github.com/repos/diging/mbl-browser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diging/mbl-browser/labels{/name}","releases_url":"https://api.github.com/repos/diging/mbl-browser/releases{/id}","deployments_url":"https://api.github.com/repos/diging/mbl-browser/deployments","created_at":"2015-09-04T21:22:46Z","updated_at":"2018-04-20T23:28:42Z","pushed_at":"2018-05-04T20:12:17Z","git_url":"git://github.com/diging/mbl-browser.git","ssh_url":"git@github.com:diging/mbl-browser.git","clone_url":"https://github.com/diging/mbl-browser.git","svn_url":"https://github.com/diging/mbl-browser","homepage":"https://amphora.asu.edu/mbl-data/","size":11272,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":0,"open_issues":2,"watchers":0,"default_branch":"develop"}},"base":{"label":"diging:develop","ref":"develop","sha":"6cb3468796efb9fba3a8e1b3065f27b4b12ea09b","user":{"login":"diging","id":5402168,"avatar_url":"https://avatars2.githubusercontent.com/u/5402168?v=4","gravatar_id":"","url":"https://api.github.com/users/diging","html_url":"https://github.com/diging","followers_url":"https://api.github.com/users/diging/followers","following_url":"https://api.github.com/users/diging/following{/other_user}","gists_url":"https://api.github.com/users/diging/gists{/gist_id}","starred_url":"https://api.github.com/users/diging/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diging/subscriptions","organizations_url":"https://api.github.com/users/diging/orgs","repos_url":"https://api.github.com/users/diging/repos","events_url":"https://api.github.com/users/diging/events{/privacy}","received_events_url":"https://api.github.com/users/diging/received_events","type":"Organization","site_admin":false},"repo":{"id":41938360,"name":"mbl-browser","full_name":"diging/mbl-browser","owner":{"login":"diging","id":5402168,"avatar_url":"https://avatars2.githubusercontent.com/u/5402168?v=4","gravatar_id":"","url":"https://api.github.com/users/diging","html_url":"https://github.com/diging","followers_url":"https://api.github.com/users/diging/followers","following_url":"https://api.github.com/users/diging/following{/other_user}","gists_url":"https://api.github.com/users/diging/gists{/gist_id}","starred_url":"https://api.github.com/users/diging/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diging/subscriptions","organizations_url":"https://api.github.com/users/diging/orgs","repos_url":"https://api.github.com/users/diging/repos","events_url":"https://api.github.com/users/diging/events{/privacy}","received_events_url":"https://api.github.com/users/diging/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/diging/mbl-browser","description":"Curation platform and API for the MBL course and investigator dataset","fork":false,"url":"https://api.github.com/repos/diging/mbl-browser","forks_url":"https://api.github.com/repos/diging/mbl-browser/forks","keys_url":"https://api.github.com/repos/diging/mbl-browser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/diging/mbl-browser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/diging/mbl-browser/teams","hooks_url":"https://api.github.com/repos/diging/mbl-browser/hooks","issue_events_url":"https://api.github.com/repos/diging/mbl-browser/issues/events{/number}","events_url":"https://api.github.com/repos/diging/mbl-browser/events","assignees_url":"https://api.github.com/repos/diging/mbl-browser/assignees{/user}","branches_url":"https://api.github.com/repos/diging/mbl-browser/branches{/branch}","tags_url":"https://api.github.com/repos/diging/mbl-browser/tags","blobs_url":"https://api.github.com/repos/diging/mbl-browser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/diging/mbl-browser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/diging/mbl-browser/git/refs{/sha}","trees_url":"https://api.github.com/repos/diging/mbl-browser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/diging/mbl-browser/statuses/{sha}","languages_url":"https://api.github.com/repos/diging/mbl-browser/languages","stargazers_url":"https://api.github.com/repos/diging/mbl-browser/stargazers","contributors_url":"https://api.github.com/repos/diging/mbl-browser/contributors","subscribers_url":"https://api.github.com/repos/diging/mbl-browser/subscribers","subscription_url":"https://api.github.com/repos/diging/mbl-browser/subscription","commits_url":"https://api.github.com/repos/diging/mbl-browser/commits{/sha}","git_commits_url":"https://api.github.com/repos/diging/mbl-browser/git/commits{/sha}","comments_url":"https://api.github.com/repos/diging/mbl-browser/comments{/number}","issue_comment_url":"https://api.github.com/repos/diging/mbl-browser/issues/comments{/number}","contents_url":"https://api.github.com/repos/diging/mbl-browser/contents/{+path}","compare_url":"https://api.github.com/repos/diging/mbl-browser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/diging/mbl-browser/merges","archive_url":"https://api.github.com/repos/diging/mbl-browser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/diging/mbl-browser/downloads","issues_url":"https://api.github.com/repos/diging/mbl-browser/issues{/number}","pulls_url":"https://api.github.com/repos/diging/mbl-browser/pulls{/number}","milestones_url":"https://api.github.com/repos/diging/mbl-browser/milestones{/number}","notifications_url":"https://api.github.com/repos/diging/mbl-browser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/diging/mbl-browser/labels{/name}","releases_url":"https://api.github.com/repos/diging/mbl-browser/releases{/id}","deployments_url":"https://api.github.com/repos/diging/mbl-browser/deployments","created_at":"2015-09-04T21:22:46Z","updated_at":"2018-04-20T23:28:42Z","pushed_at":"2018-05-04T20:12:17Z","git_url":"git://github.com/diging/mbl-browser.git","ssh_url":"git@github.com:diging/mbl-browser.git","clone_url":"https://github.com/diging/mbl-browser.git","svn_url":"https://github.com/diging/mbl-browser","homepage":"https://amphora.asu.edu/mbl-data/","size":11272,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0"},"forks":0,"open_issues":2,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/diging/mbl-browser/pulls/9"},"html":{"href":"https://github.com/diging/mbl-browser/pull/9"},"issue":{"href":"https://api.github.com/repos/diging/mbl-browser/issues/9"},"comments":{"href":"https://api.github.com/repos/diging/mbl-browser/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/diging/mbl-browser/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/diging/mbl-browser/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/diging/mbl-browser/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/diging/mbl-browser/statuses/7d2561969ec57d154430b93e03052bcd7d33094e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jdamerow"}}