{"action":"created","comment":{"url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/pulls/comments/54609668","id":54609668,"diff_hunk":"@@ -232,6 +238,116 @@\n                     $scope.createCourseInstance(response.data.course_id);\n                 }, $scope.handleAjaxErrorWithMessage\n                 );\n+\n+        };\n+\n+        $scope.createCanvasCourse = function(){\n+            //format the department info to be passed into canvas as an account id\n+            var departmentId = 'dept:' + $scope.departments[\n+                    $scope.course.codeType.toLowerCase()];\n+            //build the term ids in Canvas's format (academic_year-term_code)\n+            var termId = $scope.newCourseInstance.term.academic_year + \"-\"\n+                + $scope.newCourseInstance.term.term_code;\n+            var url = djangoUrl.reverse(\n+                'bulk_site_creation:api_create_canvas_course');\n+\n+            var data = {\n+                dept_id: departmentId,\n+                course_instance_id: $scope.newCourseInstance.course_instance_id,\n+                course_code: $scope.course.code,\n+                section_id: $scope.newCourseInstance.section,\n+                term_id: termId,\n+                title: $scope.course.title,\n+                short_title: $scope.course.shortTitle,\n+                school: $scope.school.id,\n+            };\n+            $http.post(url, data).then(\n+                function setCanvasCourse(response){\n+                    $scope.canvasCourse = response.data;\n+                    $scope.updateTablesWithCanvasCourseInfo();\n+                },function handleError(response) {\n+                    $scope.handleAjaxErrorWithMessage(response,\n+                        \"There was either a problem creating the Canvas site or \" +\n+                        \"creating the section for this course. \" +\n+                        $scope.errorMessageSupport);","path":"bulk_site_creation/static/bulk_site_creation/js/controllers/CreateNewCourseController.js","position":80,"original_position":80,"commit_id":"3e1f9c4b073e05052e8dd6d78700a09241437dd3","original_commit_id":"3e1f9c4b073e05052e8dd6d78700a09241437dd3","user":{"login":"rascalking","id":707505,"avatar_url":"https://avatars.githubusercontent.com/u/707505?v=3","gravatar_id":"","url":"https://api.github.com/users/rascalking","html_url":"https://github.com/rascalking","followers_url":"https://api.github.com/users/rascalking/followers","following_url":"https://api.github.com/users/rascalking/following{/other_user}","gists_url":"https://api.github.com/users/rascalking/gists{/gist_id}","starred_url":"https://api.github.com/users/rascalking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rascalking/subscriptions","organizations_url":"https://api.github.com/users/rascalking/orgs","repos_url":"https://api.github.com/users/rascalking/repos","events_url":"https://api.github.com/users/rascalking/events{/privacy}","received_events_url":"https://api.github.com/users/rascalking/received_events","type":"User","site_admin":false},"body":"It looks like we're always passing this into `handleAjaxErrorWithMessage`.  Can we just append it there instead?","created_at":"2016-03-01T18:18:39Z","updated_at":"2016-03-01T18:18:39Z","html_url":"https://github.com/Harvard-University-iCommons/icommons_lti_tools/pull/426#discussion_r54609668","pull_request_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/pulls/426","_links":{"self":{"href":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/pulls/comments/54609668"},"html":{"href":"https://github.com/Harvard-University-iCommons/icommons_lti_tools/pull/426#discussion_r54609668"},"pull_request":{"href":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/pulls/426"}}},"pull_request":{"url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/pulls/426","id":61276550,"html_url":"https://github.com/Harvard-University-iCommons/icommons_lti_tools/pull/426","diff_url":"https://github.com/Harvard-University-iCommons/icommons_lti_tools/pull/426.diff","patch_url":"https://github.com/Harvard-University-iCommons/icommons_lti_tools/pull/426.patch","issue_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/issues/426","number":426,"state":"open","locked":false,"title":"Task/sapnamysore/tlt 2419/create canvas course","user":{"login":"sapnamysore","id":1084105,"avatar_url":"https://avatars.githubusercontent.com/u/1084105?v=3","gravatar_id":"","url":"https://api.github.com/users/sapnamysore","html_url":"https://github.com/sapnamysore","followers_url":"https://api.github.com/users/sapnamysore/followers","following_url":"https://api.github.com/users/sapnamysore/following{/other_user}","gists_url":"https://api.github.com/users/sapnamysore/gists{/gist_id}","starred_url":"https://api.github.com/users/sapnamysore/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sapnamysore/subscriptions","organizations_url":"https://api.github.com/users/sapnamysore/orgs","repos_url":"https://api.github.com/users/sapnamysore/repos","events_url":"https://api.github.com/users/sapnamysore/events{/privacy}","received_events_url":"https://api.github.com/users/sapnamysore/received_events","type":"User","site_admin":false},"body":"This PR contains changes for 2419  https://jira.huit.harvard.edu/browse/TLT-2419.\r\n\r\nBroad workflow:\r\n- Create canvas course and Create section(sdk calls)\r\n- post the course site\r\n- post site map\r\n- patch the CI record with canvas course id and sync_to_canvas=1:\r\n-refresh the link in UI\r\n\r\nAnd error handling to render useful for the user to report , when a failure occurs.","created_at":"2016-03-01T17:19:22Z","updated_at":"2016-03-01T18:18:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d712cdfcc5f83c7e57eae576c617aa012552ff0a","assignee":{"login":"rascalking","id":707505,"avatar_url":"https://avatars.githubusercontent.com/u/707505?v=3","gravatar_id":"","url":"https://api.github.com/users/rascalking","html_url":"https://github.com/rascalking","followers_url":"https://api.github.com/users/rascalking/followers","following_url":"https://api.github.com/users/rascalking/following{/other_user}","gists_url":"https://api.github.com/users/rascalking/gists{/gist_id}","starred_url":"https://api.github.com/users/rascalking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rascalking/subscriptions","organizations_url":"https://api.github.com/users/rascalking/orgs","repos_url":"https://api.github.com/users/rascalking/repos","events_url":"https://api.github.com/users/rascalking/events{/privacy}","received_events_url":"https://api.github.com/users/rascalking/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/pulls/426/commits","review_comments_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/pulls/426/comments","review_comment_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/issues/426/comments","statuses_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/statuses/3e1f9c4b073e05052e8dd6d78700a09241437dd3","head":{"label":"Harvard-University-iCommons:task/sapnamysore/TLT-2419/create-canvas-course","ref":"task/sapnamysore/TLT-2419/create-canvas-course","sha":"3e1f9c4b073e05052e8dd6d78700a09241437dd3","user":{"login":"Harvard-University-iCommons","id":1083915,"avatar_url":"https://avatars.githubusercontent.com/u/1083915?v=3","gravatar_id":"","url":"https://api.github.com/users/Harvard-University-iCommons","html_url":"https://github.com/Harvard-University-iCommons","followers_url":"https://api.github.com/users/Harvard-University-iCommons/followers","following_url":"https://api.github.com/users/Harvard-University-iCommons/following{/other_user}","gists_url":"https://api.github.com/users/Harvard-University-iCommons/gists{/gist_id}","starred_url":"https://api.github.com/users/Harvard-University-iCommons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Harvard-University-iCommons/subscriptions","organizations_url":"https://api.github.com/users/Harvard-University-iCommons/orgs","repos_url":"https://api.github.com/users/Harvard-University-iCommons/repos","events_url":"https://api.github.com/users/Harvard-University-iCommons/events{/privacy}","received_events_url":"https://api.github.com/users/Harvard-University-iCommons/received_events","type":"Organization","site_admin":false},"repo":{"id":14696916,"name":"icommons_lti_tools","full_name":"Harvard-University-iCommons/icommons_lti_tools","owner":{"login":"Harvard-University-iCommons","id":1083915,"avatar_url":"https://avatars.githubusercontent.com/u/1083915?v=3","gravatar_id":"","url":"https://api.github.com/users/Harvard-University-iCommons","html_url":"https://github.com/Harvard-University-iCommons","followers_url":"https://api.github.com/users/Harvard-University-iCommons/followers","following_url":"https://api.github.com/users/Harvard-University-iCommons/following{/other_user}","gists_url":"https://api.github.com/users/Harvard-University-iCommons/gists{/gist_id}","starred_url":"https://api.github.com/users/Harvard-University-iCommons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Harvard-University-iCommons/subscriptions","organizations_url":"https://api.github.com/users/Harvard-University-iCommons/orgs","repos_url":"https://api.github.com/users/Harvard-University-iCommons/repos","events_url":"https://api.github.com/users/Harvard-University-iCommons/events{/privacy}","received_events_url":"https://api.github.com/users/Harvard-University-iCommons/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Harvard-University-iCommons/icommons_lti_tools","description":"LTI tools for Canvas","fork":false,"url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools","forks_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/forks","keys_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/teams","hooks_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/hooks","issue_events_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/issues/events{/number}","events_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/events","assignees_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/assignees{/user}","branches_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/branches{/branch}","tags_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/tags","blobs_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/statuses/{sha}","languages_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/languages","stargazers_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/stargazers","contributors_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/contributors","subscribers_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/subscribers","subscription_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/subscription","commits_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/contents/{+path}","compare_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/merges","archive_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/downloads","issues_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/issues{/number}","pulls_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/pulls{/number}","milestones_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/milestones{/number}","notifications_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/labels{/name}","releases_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/releases{/id}","deployments_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/deployments","created_at":"2013-11-25T20:06:20Z","updated_at":"2016-01-12T15:50:26Z","pushed_at":"2016-03-01T17:25:57Z","git_url":"git://github.com/Harvard-University-iCommons/icommons_lti_tools.git","ssh_url":"git@github.com:Harvard-University-iCommons/icommons_lti_tools.git","clone_url":"https://github.com/Harvard-University-iCommons/icommons_lti_tools.git","svn_url":"https://github.com/Harvard-University-iCommons/icommons_lti_tools","homepage":"","size":4494,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":3,"default_branch":"develop"}},"base":{"label":"Harvard-University-iCommons:develop","ref":"develop","sha":"d1c447be2cf114e00db376ffd36827f2753a7325","user":{"login":"Harvard-University-iCommons","id":1083915,"avatar_url":"https://avatars.githubusercontent.com/u/1083915?v=3","gravatar_id":"","url":"https://api.github.com/users/Harvard-University-iCommons","html_url":"https://github.com/Harvard-University-iCommons","followers_url":"https://api.github.com/users/Harvard-University-iCommons/followers","following_url":"https://api.github.com/users/Harvard-University-iCommons/following{/other_user}","gists_url":"https://api.github.com/users/Harvard-University-iCommons/gists{/gist_id}","starred_url":"https://api.github.com/users/Harvard-University-iCommons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Harvard-University-iCommons/subscriptions","organizations_url":"https://api.github.com/users/Harvard-University-iCommons/orgs","repos_url":"https://api.github.com/users/Harvard-University-iCommons/repos","events_url":"https://api.github.com/users/Harvard-University-iCommons/events{/privacy}","received_events_url":"https://api.github.com/users/Harvard-University-iCommons/received_events","type":"Organization","site_admin":false},"repo":{"id":14696916,"name":"icommons_lti_tools","full_name":"Harvard-University-iCommons/icommons_lti_tools","owner":{"login":"Harvard-University-iCommons","id":1083915,"avatar_url":"https://avatars.githubusercontent.com/u/1083915?v=3","gravatar_id":"","url":"https://api.github.com/users/Harvard-University-iCommons","html_url":"https://github.com/Harvard-University-iCommons","followers_url":"https://api.github.com/users/Harvard-University-iCommons/followers","following_url":"https://api.github.com/users/Harvard-University-iCommons/following{/other_user}","gists_url":"https://api.github.com/users/Harvard-University-iCommons/gists{/gist_id}","starred_url":"https://api.github.com/users/Harvard-University-iCommons/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Harvard-University-iCommons/subscriptions","organizations_url":"https://api.github.com/users/Harvard-University-iCommons/orgs","repos_url":"https://api.github.com/users/Harvard-University-iCommons/repos","events_url":"https://api.github.com/users/Harvard-University-iCommons/events{/privacy}","received_events_url":"https://api.github.com/users/Harvard-University-iCommons/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Harvard-University-iCommons/icommons_lti_tools","description":"LTI tools for Canvas","fork":false,"url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools","forks_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/forks","keys_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/teams","hooks_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/hooks","issue_events_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/issues/events{/number}","events_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/events","assignees_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/assignees{/user}","branches_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/branches{/branch}","tags_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/tags","blobs_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/statuses/{sha}","languages_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/languages","stargazers_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/stargazers","contributors_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/contributors","subscribers_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/subscribers","subscription_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/subscription","commits_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/contents/{+path}","compare_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/merges","archive_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/downloads","issues_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/issues{/number}","pulls_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/pulls{/number}","milestones_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/milestones{/number}","notifications_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/labels{/name}","releases_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/releases{/id}","deployments_url":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/deployments","created_at":"2013-11-25T20:06:20Z","updated_at":"2016-01-12T15:50:26Z","pushed_at":"2016-03-01T17:25:57Z","git_url":"git://github.com/Harvard-University-iCommons/icommons_lti_tools.git","ssh_url":"git@github.com:Harvard-University-iCommons/icommons_lti_tools.git","clone_url":"https://github.com/Harvard-University-iCommons/icommons_lti_tools.git","svn_url":"https://github.com/Harvard-University-iCommons/icommons_lti_tools","homepage":"","size":4494,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":3,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/pulls/426"},"html":{"href":"https://github.com/Harvard-University-iCommons/icommons_lti_tools/pull/426"},"issue":{"href":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/issues/426"},"comments":{"href":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/issues/426/comments"},"review_comments":{"href":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/pulls/426/comments"},"review_comment":{"href":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/pulls/426/commits"},"statuses":{"href":"https://api.github.com/repos/Harvard-University-iCommons/icommons_lti_tools/statuses/3e1f9c4b073e05052e8dd6d78700a09241437dd3"}}}}