{"action":"created","comment":{"url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/comments/31654818","id":31654818,"diff_hunk":"@@ -93,10 +93,36 @@ def itsi_auth(request):\n     else:\n         # User did not authenticate. Save their ITSI ID and send to /register\n         request.session['itsi_id'] = itsi_user['id']\n-        return redirect('/register')  # TODO Make this Backbone route\n+        return redirect('/register/{username}/{first_name}/{last_name}'.format(\n+            **itsi_user['extra']\n+        ))\n \n \n+@decorators.api_view(['POST'])\n+@decorators.permission_classes((AllowAny, ))\n def itsi_register(request):\n+    # Validate request\n+    errors = []\n+    if 'itsi_id' not in request.session:\n+        errors.append(\"There was an error in authenticating you with ITSI\")\n+\n+    if 'username' not in request.POST or not request.POST.get('username'):","path":"src/mmw/apps/user/views.py","position":18,"original_position":18,"commit_id":"6196538d853bd826b66e5f66773b4495c4d85bbf","original_commit_id":"6196538d853bd826b66e5f66773b4495c4d85bbf","user":{"login":"rajadain","id":1430060,"avatar_url":"https://avatars.githubusercontent.com/u/1430060?v=3","gravatar_id":"","url":"https://api.github.com/users/rajadain","html_url":"https://github.com/rajadain","followers_url":"https://api.github.com/users/rajadain/followers","following_url":"https://api.github.com/users/rajadain/following{/other_user}","gists_url":"https://api.github.com/users/rajadain/gists{/gist_id}","starred_url":"https://api.github.com/users/rajadain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rajadain/subscriptions","organizations_url":"https://api.github.com/users/rajadain/orgs","repos_url":"https://api.github.com/users/rajadain/repos","events_url":"https://api.github.com/users/rajadain/events{/privacy}","received_events_url":"https://api.github.com/users/rajadain/received_events","type":"User","site_admin":false},"body":"YES thank you that's what I was looking for. This stuff is impossible to phrase into a Google query, but easily caught by those more experienced with the language's idioms.","created_at":"2015-06-03T18:34:32Z","updated_at":"2015-06-03T18:34:32Z","html_url":"https://github.com/WikiWatershed/model-my-watershed/pull/268#discussion_r31654818","pull_request_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/268","_links":{"self":{"href":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/comments/31654818"},"html":{"href":"https://github.com/WikiWatershed/model-my-watershed/pull/268#discussion_r31654818"},"pull_request":{"href":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/268"}}},"pull_request":{"url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/268","id":36771894,"html_url":"https://github.com/WikiWatershed/model-my-watershed/pull/268","diff_url":"https://github.com/WikiWatershed/model-my-watershed/pull/268.diff","patch_url":"https://github.com/WikiWatershed/model-my-watershed/pull/268.patch","issue_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/issues/268","number":268,"state":"open","locked":false,"title":"ITSI Registration front-end","user":{"login":"rajadain","id":1430060,"avatar_url":"https://avatars.githubusercontent.com/u/1430060?v=3","gravatar_id":"","url":"https://api.github.com/users/rajadain","html_url":"https://github.com/rajadain","followers_url":"https://api.github.com/users/rajadain/followers","following_url":"https://api.github.com/users/rajadain/following{/other_user}","gists_url":"https://api.github.com/users/rajadain/gists{/gist_id}","starred_url":"https://api.github.com/users/rajadain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rajadain/subscriptions","organizations_url":"https://api.github.com/users/rajadain/orgs","repos_url":"https://api.github.com/users/rajadain/repos","events_url":"https://api.github.com/users/rajadain/events{/privacy}","received_events_url":"https://api.github.com/users/rajadain/received_events","type":"User","site_admin":false},"body":"Adds a login and registration front-end for users logging in with ITSI.\r\n\r\n**Before You Begin**\r\n\r\nPlease check if the `MMW_ITSI_SECRET_KEY` variable is set on your `app` VM:\r\n\r\n    vagrant ssh app -c 'cat /etc/mmw.d/env/MMW_ITSI_SECRET_KEY'\r\n\r\nIf it isn't, you must reprovision the `app` VM with the `MMW_ITSI_SECRET_KEY` variable set, like so:\r\n\r\n    MMW_ITSI_SECRET_KEY=*** vagrant provision app\r\n\r\nThe secret key is available in the wiki.\r\n\r\n**Testing Instructions**\r\n\r\n 1. Open [http://localhost:8000/](http://localhost:8000/). You should see a new login page that matches the latest mockups.\r\n 2. Click on \"ITSI\". You should be taken to the ITSI portal.\r\n 3. Log in with either the `tstudent2` or `mmwterence` account to ITSI (credentials are available in the wiki). You should be redirected to the registration front-end, and the `username`, `first_name`, and `last_name` fields should be pre-populated.\r\n 4. Check \"I agree to something\" and click \"Sign Up\". If there aren't any validation errors, the registration modal should dismiss and you should be logged in, apparent from the username in the top right hand corner.\r\n 5. Refresh the page to check that you are still logged in as this newly created user.\r\n 6. Log out of this account. Click \"Login\", and again click \"ITSI\". You will be redirected to the ITSI portal again, but since you recently logged in there you should be redirected right back to our app which should automatically log you in.\r\n\r\n**Alternate Paths**\r\n\r\n * Try going to [`/register`](http://localhost:8000/register) directly and registering.\r\n * Try dismissing the modal during registration.\r\n * Try signing up as an already existing username.\r\n\r\n**Notes**\r\n\r\n * The mockup has a line from edge to edge behind the \"Or continue as\" text which I don't know how to add:  \r\n![screen shot 2015-06-02 at 4 28 32 pm](https://cloud.githubusercontent.com/assets/1430060/7946427/93c1ce52-0944-11e5-817c-8de6eb240a54.png)\r\n * We pass back the username, first and last names received from ITSI to the registration modal via the query string. Is this a security / aesthetic issue? Should we use cookies or some other \"under the hood\" mechanism which is uglier in code but cleaner in the UI?\r\n * Unlike regular sign-up / login, the ITSI login requires full page refreshes and is not an XHR-only operation. This should be kept in mind when creating mechanisms to save temporary work in case the user decides to create an account using ITSI mid-way through an unsaved project.\r\n * We now have a handful of modal views that are very similar in basic operation. Perhaps we should refactor the commonalities into a utility class and derive from that instead.\r\n * I needed to add some styling for the login modal updates. I decided to add it under `sass/base/_login.scss` and not `sass/pages/_login.scss` because the login is a modal, not a page, and would be available throughout the app, not just in a particular view. If this was not the right place to add it, please let me know and I will correct it.\r\n\r\nConnects #180 ","created_at":"2015-06-02T20:43:09Z","updated_at":"2015-06-03T18:34:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"965c7aee71a4dea7b9ac8777fd754697cbd003e8","assignee":{"login":"mmcfarland","id":1014341,"avatar_url":"https://avatars.githubusercontent.com/u/1014341?v=3","gravatar_id":"","url":"https://api.github.com/users/mmcfarland","html_url":"https://github.com/mmcfarland","followers_url":"https://api.github.com/users/mmcfarland/followers","following_url":"https://api.github.com/users/mmcfarland/following{/other_user}","gists_url":"https://api.github.com/users/mmcfarland/gists{/gist_id}","starred_url":"https://api.github.com/users/mmcfarland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmcfarland/subscriptions","organizations_url":"https://api.github.com/users/mmcfarland/orgs","repos_url":"https://api.github.com/users/mmcfarland/repos","events_url":"https://api.github.com/users/mmcfarland/events{/privacy}","received_events_url":"https://api.github.com/users/mmcfarland/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/268/commits","review_comments_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/268/comments","review_comment_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/issues/268/comments","statuses_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/statuses/6196538d853bd826b66e5f66773b4495c4d85bbf","head":{"label":"rajadain:feature/itsi-registration","ref":"feature/itsi-registration","sha":"6196538d853bd826b66e5f66773b4495c4d85bbf","user":{"login":"rajadain","id":1430060,"avatar_url":"https://avatars.githubusercontent.com/u/1430060?v=3","gravatar_id":"","url":"https://api.github.com/users/rajadain","html_url":"https://github.com/rajadain","followers_url":"https://api.github.com/users/rajadain/followers","following_url":"https://api.github.com/users/rajadain/following{/other_user}","gists_url":"https://api.github.com/users/rajadain/gists{/gist_id}","starred_url":"https://api.github.com/users/rajadain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rajadain/subscriptions","organizations_url":"https://api.github.com/users/rajadain/orgs","repos_url":"https://api.github.com/users/rajadain/repos","events_url":"https://api.github.com/users/rajadain/events{/privacy}","received_events_url":"https://api.github.com/users/rajadain/received_events","type":"User","site_admin":false},"repo":{"id":36075102,"name":"model-my-watershed","full_name":"rajadain/model-my-watershed","owner":{"login":"rajadain","id":1430060,"avatar_url":"https://avatars.githubusercontent.com/u/1430060?v=3","gravatar_id":"","url":"https://api.github.com/users/rajadain","html_url":"https://github.com/rajadain","followers_url":"https://api.github.com/users/rajadain/followers","following_url":"https://api.github.com/users/rajadain/following{/other_user}","gists_url":"https://api.github.com/users/rajadain/gists{/gist_id}","starred_url":"https://api.github.com/users/rajadain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rajadain/subscriptions","organizations_url":"https://api.github.com/users/rajadain/orgs","repos_url":"https://api.github.com/users/rajadain/repos","events_url":"https://api.github.com/users/rajadain/events{/privacy}","received_events_url":"https://api.github.com/users/rajadain/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rajadain/model-my-watershed","description":"The web application front end for Model My Watershed.","fork":true,"url":"https://api.github.com/repos/rajadain/model-my-watershed","forks_url":"https://api.github.com/repos/rajadain/model-my-watershed/forks","keys_url":"https://api.github.com/repos/rajadain/model-my-watershed/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rajadain/model-my-watershed/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rajadain/model-my-watershed/teams","hooks_url":"https://api.github.com/repos/rajadain/model-my-watershed/hooks","issue_events_url":"https://api.github.com/repos/rajadain/model-my-watershed/issues/events{/number}","events_url":"https://api.github.com/repos/rajadain/model-my-watershed/events","assignees_url":"https://api.github.com/repos/rajadain/model-my-watershed/assignees{/user}","branches_url":"https://api.github.com/repos/rajadain/model-my-watershed/branches{/branch}","tags_url":"https://api.github.com/repos/rajadain/model-my-watershed/tags","blobs_url":"https://api.github.com/repos/rajadain/model-my-watershed/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rajadain/model-my-watershed/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rajadain/model-my-watershed/git/refs{/sha}","trees_url":"https://api.github.com/repos/rajadain/model-my-watershed/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rajadain/model-my-watershed/statuses/{sha}","languages_url":"https://api.github.com/repos/rajadain/model-my-watershed/languages","stargazers_url":"https://api.github.com/repos/rajadain/model-my-watershed/stargazers","contributors_url":"https://api.github.com/repos/rajadain/model-my-watershed/contributors","subscribers_url":"https://api.github.com/repos/rajadain/model-my-watershed/subscribers","subscription_url":"https://api.github.com/repos/rajadain/model-my-watershed/subscription","commits_url":"https://api.github.com/repos/rajadain/model-my-watershed/commits{/sha}","git_commits_url":"https://api.github.com/repos/rajadain/model-my-watershed/git/commits{/sha}","comments_url":"https://api.github.com/repos/rajadain/model-my-watershed/comments{/number}","issue_comment_url":"https://api.github.com/repos/rajadain/model-my-watershed/issues/comments{/number}","contents_url":"https://api.github.com/repos/rajadain/model-my-watershed/contents/{+path}","compare_url":"https://api.github.com/repos/rajadain/model-my-watershed/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rajadain/model-my-watershed/merges","archive_url":"https://api.github.com/repos/rajadain/model-my-watershed/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rajadain/model-my-watershed/downloads","issues_url":"https://api.github.com/repos/rajadain/model-my-watershed/issues{/number}","pulls_url":"https://api.github.com/repos/rajadain/model-my-watershed/pulls{/number}","milestones_url":"https://api.github.com/repos/rajadain/model-my-watershed/milestones{/number}","notifications_url":"https://api.github.com/repos/rajadain/model-my-watershed/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rajadain/model-my-watershed/labels{/name}","releases_url":"https://api.github.com/repos/rajadain/model-my-watershed/releases{/id}","created_at":"2015-05-22T13:58:22Z","updated_at":"2015-05-22T13:58:23Z","pushed_at":"2015-06-03T14:22:27Z","git_url":"git://github.com/rajadain/model-my-watershed.git","ssh_url":"git@github.com:rajadain/model-my-watershed.git","clone_url":"https://github.com/rajadain/model-my-watershed.git","svn_url":"https://github.com/rajadain/model-my-watershed","homepage":null,"size":13431,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"WikiWatershed:develop","ref":"develop","sha":"88c0ffedab06bc0b46b878d1779638e1022d30ee","user":{"login":"WikiWatershed","id":8520008,"avatar_url":"https://avatars.githubusercontent.com/u/8520008?v=3","gravatar_id":"","url":"https://api.github.com/users/WikiWatershed","html_url":"https://github.com/WikiWatershed","followers_url":"https://api.github.com/users/WikiWatershed/followers","following_url":"https://api.github.com/users/WikiWatershed/following{/other_user}","gists_url":"https://api.github.com/users/WikiWatershed/gists{/gist_id}","starred_url":"https://api.github.com/users/WikiWatershed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WikiWatershed/subscriptions","organizations_url":"https://api.github.com/users/WikiWatershed/orgs","repos_url":"https://api.github.com/users/WikiWatershed/repos","events_url":"https://api.github.com/users/WikiWatershed/events{/privacy}","received_events_url":"https://api.github.com/users/WikiWatershed/received_events","type":"Organization","site_admin":false},"repo":{"id":32742922,"name":"model-my-watershed","full_name":"WikiWatershed/model-my-watershed","owner":{"login":"WikiWatershed","id":8520008,"avatar_url":"https://avatars.githubusercontent.com/u/8520008?v=3","gravatar_id":"","url":"https://api.github.com/users/WikiWatershed","html_url":"https://github.com/WikiWatershed","followers_url":"https://api.github.com/users/WikiWatershed/followers","following_url":"https://api.github.com/users/WikiWatershed/following{/other_user}","gists_url":"https://api.github.com/users/WikiWatershed/gists{/gist_id}","starred_url":"https://api.github.com/users/WikiWatershed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WikiWatershed/subscriptions","organizations_url":"https://api.github.com/users/WikiWatershed/orgs","repos_url":"https://api.github.com/users/WikiWatershed/repos","events_url":"https://api.github.com/users/WikiWatershed/events{/privacy}","received_events_url":"https://api.github.com/users/WikiWatershed/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WikiWatershed/model-my-watershed","description":"The web application front end for Model My Watershed.","fork":false,"url":"https://api.github.com/repos/WikiWatershed/model-my-watershed","forks_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/forks","keys_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/teams","hooks_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/hooks","issue_events_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/issues/events{/number}","events_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/events","assignees_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/assignees{/user}","branches_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/branches{/branch}","tags_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/tags","blobs_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/git/refs{/sha}","trees_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/statuses/{sha}","languages_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/languages","stargazers_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/stargazers","contributors_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/contributors","subscribers_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/subscribers","subscription_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/subscription","commits_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/commits{/sha}","git_commits_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/git/commits{/sha}","comments_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/comments{/number}","issue_comment_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/issues/comments{/number}","contents_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/contents/{+path}","compare_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/merges","archive_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/downloads","issues_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/issues{/number}","pulls_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls{/number}","milestones_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/milestones{/number}","notifications_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/labels{/name}","releases_url":"https://api.github.com/repos/WikiWatershed/model-my-watershed/releases{/id}","created_at":"2015-03-23T16:02:55Z","updated_at":"2015-05-26T15:38:16Z","pushed_at":"2015-06-03T17:54:59Z","git_url":"git://github.com/WikiWatershed/model-my-watershed.git","ssh_url":"git@github.com:WikiWatershed/model-my-watershed.git","clone_url":"https://github.com/WikiWatershed/model-my-watershed.git","svn_url":"https://github.com/WikiWatershed/model-my-watershed","homepage":null,"size":15559,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":85,"forks":8,"open_issues":85,"watchers":2,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/268"},"html":{"href":"https://github.com/WikiWatershed/model-my-watershed/pull/268"},"issue":{"href":"https://api.github.com/repos/WikiWatershed/model-my-watershed/issues/268"},"comments":{"href":"https://api.github.com/repos/WikiWatershed/model-my-watershed/issues/268/comments"},"review_comments":{"href":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/268/comments"},"review_comment":{"href":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WikiWatershed/model-my-watershed/pulls/268/commits"},"statuses":{"href":"https://api.github.com/repos/WikiWatershed/model-my-watershed/statuses/6196538d853bd826b66e5f66773b4495c4d85bbf"}}}}