{"action":"created","comment":{"url":"https://api.github.com/repos/starteam/starcellbio_html/pulls/comments/28916014","id":28916014,"diff_hunk":"@@ -2,51 +2,37 @@\n \n from django import forms\n \n-from backend.models import UserCourse, Course, Assignment\n-from django.contrib.auth.models import User, Group\n+from backend.models import UserCourse, Course\n+from django.contrib.auth.models import Group\n \n-import StarCellBio.settings as settings\n \n class SignupForm(forms.Form):\n-\tdef save(self, request):\n-\t\timport sys\n-\t\timport os\n-\t\timport pudb\n-# \t\tpudb.set_trace()\n-\t\tif(self.data.get('account_type') == 'student'):\n-\t\t\tcreate_course_records(request,self.data.get('CC'))\n-# \t\telif(self.data.get('account_type') == 'instructor'):\n-\t\tadd_to_group(request, self.data.get('account_type'))\n+\n+    def save(self, request):\n+        print request\n+        if self.data.get('account_type') == 'student':\n+            create_course_records(request, self.data.get('CC'))\n+        add_to_group(request, self.data.get('account_type'))\n         \"\"\"\n         An extension point for subclasses.\n         \"\"\"\n         pass\n \n \n+def create_course_records(usr, cc_input):\n+    cc_input = cc_input.replace(' ', '')\n+    course_codes = cc_input.split(';')\n+    for course_code in course_codes:\n+        if Course.objects.filter(code=course_code).count() > 0:\n+            course = Course.objects.get(code=course_code)\n+            user_course = UserCourse(course_name=course_code, user=usr, courseID=course)\n+            user_course.save()\n+            print course_code","path":"auth/forms.py","position":41,"original_position":41,"commit_id":"9dc8f6bb8f4c92f9153136b7886bcbc42f6f5d43","original_commit_id":"9dc8f6bb8f4c92f9153136b7886bcbc42f6f5d43","user":{"login":"carsongee","id":596029,"avatar_url":"https://avatars.githubusercontent.com/u/596029?v=3","gravatar_id":"","url":"https://api.github.com/users/carsongee","html_url":"https://github.com/carsongee","followers_url":"https://api.github.com/users/carsongee/followers","following_url":"https://api.github.com/users/carsongee/following{/other_user}","gists_url":"https://api.github.com/users/carsongee/gists{/gist_id}","starred_url":"https://api.github.com/users/carsongee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carsongee/subscriptions","organizations_url":"https://api.github.com/users/carsongee/orgs","repos_url":"https://api.github.com/users/carsongee/repos","events_url":"https://api.github.com/users/carsongee/events{/privacy}","received_events_url":"https://api.github.com/users/carsongee/received_events","type":"User","site_admin":false},"body":"same here","created_at":"2015-04-22T21:20:15Z","updated_at":"2015-04-22T21:20:15Z","html_url":"https://github.com/starteam/starcellbio_html/pull/178#discussion_r28916014","pull_request_url":"https://api.github.com/repos/starteam/starcellbio_html/pulls/178","_links":{"self":{"href":"https://api.github.com/repos/starteam/starcellbio_html/pulls/comments/28916014"},"html":{"href":"https://github.com/starteam/starcellbio_html/pull/178#discussion_r28916014"},"pull_request":{"href":"https://api.github.com/repos/starteam/starcellbio_html/pulls/178"}}},"pull_request":{"url":"https://api.github.com/repos/starteam/starcellbio_html/pulls/178","id":33900718,"html_url":"https://github.com/starteam/starcellbio_html/pull/178","diff_url":"https://github.com/starteam/starcellbio_html/pull/178.diff","patch_url":"https://github.com/starteam/starcellbio_html/pull/178.patch","issue_url":"https://api.github.com/repos/starteam/starcellbio_html/issues/178","number":178,"state":"open","locked":false,"title":" auth forms.py code reformat","user":{"login":"annagav","id":7574259,"avatar_url":"https://avatars.githubusercontent.com/u/7574259?v=3","gravatar_id":"","url":"https://api.github.com/users/annagav","html_url":"https://github.com/annagav","followers_url":"https://api.github.com/users/annagav/followers","following_url":"https://api.github.com/users/annagav/following{/other_user}","gists_url":"https://api.github.com/users/annagav/gists{/gist_id}","starred_url":"https://api.github.com/users/annagav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annagav/subscriptions","organizations_url":"https://api.github.com/users/annagav/orgs","repos_url":"https://api.github.com/users/annagav/repos","events_url":"https://api.github.com/users/annagav/events{/privacy}","received_events_url":"https://api.github.com/users/annagav/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-04-22T21:01:02Z","updated_at":"2015-04-22T21:20:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"17a1106c06d16767bd0c7eb1db02aad4fdc883f8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/starteam/starcellbio_html/pulls/178/commits","review_comments_url":"https://api.github.com/repos/starteam/starcellbio_html/pulls/178/comments","review_comment_url":"https://api.github.com/repos/starteam/starcellbio_html/pulls/comments{/number}","comments_url":"https://api.github.com/repos/starteam/starcellbio_html/issues/178/comments","statuses_url":"https://api.github.com/repos/starteam/starcellbio_html/statuses/9dc8f6bb8f4c92f9153136b7886bcbc42f6f5d43","head":{"label":"annagav:feature/auth_forms_reformat","ref":"feature/auth_forms_reformat","sha":"9dc8f6bb8f4c92f9153136b7886bcbc42f6f5d43","user":{"login":"annagav","id":7574259,"avatar_url":"https://avatars.githubusercontent.com/u/7574259?v=3","gravatar_id":"","url":"https://api.github.com/users/annagav","html_url":"https://github.com/annagav","followers_url":"https://api.github.com/users/annagav/followers","following_url":"https://api.github.com/users/annagav/following{/other_user}","gists_url":"https://api.github.com/users/annagav/gists{/gist_id}","starred_url":"https://api.github.com/users/annagav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annagav/subscriptions","organizations_url":"https://api.github.com/users/annagav/orgs","repos_url":"https://api.github.com/users/annagav/repos","events_url":"https://api.github.com/users/annagav/events{/privacy}","received_events_url":"https://api.github.com/users/annagav/received_events","type":"User","site_admin":false},"repo":{"id":26652367,"name":"starcellbio_html","full_name":"annagav/starcellbio_html","owner":{"login":"annagav","id":7574259,"avatar_url":"https://avatars.githubusercontent.com/u/7574259?v=3","gravatar_id":"","url":"https://api.github.com/users/annagav","html_url":"https://github.com/annagav","followers_url":"https://api.github.com/users/annagav/followers","following_url":"https://api.github.com/users/annagav/following{/other_user}","gists_url":"https://api.github.com/users/annagav/gists{/gist_id}","starred_url":"https://api.github.com/users/annagav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annagav/subscriptions","organizations_url":"https://api.github.com/users/annagav/orgs","repos_url":"https://api.github.com/users/annagav/repos","events_url":"https://api.github.com/users/annagav/events{/privacy}","received_events_url":"https://api.github.com/users/annagav/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/annagav/starcellbio_html","description":"","fork":true,"url":"https://api.github.com/repos/annagav/starcellbio_html","forks_url":"https://api.github.com/repos/annagav/starcellbio_html/forks","keys_url":"https://api.github.com/repos/annagav/starcellbio_html/keys{/key_id}","collaborators_url":"https://api.github.com/repos/annagav/starcellbio_html/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/annagav/starcellbio_html/teams","hooks_url":"https://api.github.com/repos/annagav/starcellbio_html/hooks","issue_events_url":"https://api.github.com/repos/annagav/starcellbio_html/issues/events{/number}","events_url":"https://api.github.com/repos/annagav/starcellbio_html/events","assignees_url":"https://api.github.com/repos/annagav/starcellbio_html/assignees{/user}","branches_url":"https://api.github.com/repos/annagav/starcellbio_html/branches{/branch}","tags_url":"https://api.github.com/repos/annagav/starcellbio_html/tags","blobs_url":"https://api.github.com/repos/annagav/starcellbio_html/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/annagav/starcellbio_html/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/annagav/starcellbio_html/git/refs{/sha}","trees_url":"https://api.github.com/repos/annagav/starcellbio_html/git/trees{/sha}","statuses_url":"https://api.github.com/repos/annagav/starcellbio_html/statuses/{sha}","languages_url":"https://api.github.com/repos/annagav/starcellbio_html/languages","stargazers_url":"https://api.github.com/repos/annagav/starcellbio_html/stargazers","contributors_url":"https://api.github.com/repos/annagav/starcellbio_html/contributors","subscribers_url":"https://api.github.com/repos/annagav/starcellbio_html/subscribers","subscription_url":"https://api.github.com/repos/annagav/starcellbio_html/subscription","commits_url":"https://api.github.com/repos/annagav/starcellbio_html/commits{/sha}","git_commits_url":"https://api.github.com/repos/annagav/starcellbio_html/git/commits{/sha}","comments_url":"https://api.github.com/repos/annagav/starcellbio_html/comments{/number}","issue_comment_url":"https://api.github.com/repos/annagav/starcellbio_html/issues/comments{/number}","contents_url":"https://api.github.com/repos/annagav/starcellbio_html/contents/{+path}","compare_url":"https://api.github.com/repos/annagav/starcellbio_html/compare/{base}...{head}","merges_url":"https://api.github.com/repos/annagav/starcellbio_html/merges","archive_url":"https://api.github.com/repos/annagav/starcellbio_html/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/annagav/starcellbio_html/downloads","issues_url":"https://api.github.com/repos/annagav/starcellbio_html/issues{/number}","pulls_url":"https://api.github.com/repos/annagav/starcellbio_html/pulls{/number}","milestones_url":"https://api.github.com/repos/annagav/starcellbio_html/milestones{/number}","notifications_url":"https://api.github.com/repos/annagav/starcellbio_html/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/annagav/starcellbio_html/labels{/name}","releases_url":"https://api.github.com/repos/annagav/starcellbio_html/releases{/id}","created_at":"2014-11-14T18:45:00Z","updated_at":"2014-11-14T18:45:01Z","pushed_at":"2015-04-22T20:59:40Z","git_url":"git://github.com/annagav/starcellbio_html.git","ssh_url":"git@github.com:annagav/starcellbio_html.git","clone_url":"https://github.com/annagav/starcellbio_html.git","svn_url":"https://github.com/annagav/starcellbio_html","homepage":null,"size":316285,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"starteam:develop","ref":"develop","sha":"3b6632346f70dc9e89cf3e0f842476553ab5816c","user":{"login":"starteam","id":2973496,"avatar_url":"https://avatars.githubusercontent.com/u/2973496?v=3","gravatar_id":"","url":"https://api.github.com/users/starteam","html_url":"https://github.com/starteam","followers_url":"https://api.github.com/users/starteam/followers","following_url":"https://api.github.com/users/starteam/following{/other_user}","gists_url":"https://api.github.com/users/starteam/gists{/gist_id}","starred_url":"https://api.github.com/users/starteam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/starteam/subscriptions","organizations_url":"https://api.github.com/users/starteam/orgs","repos_url":"https://api.github.com/users/starteam/repos","events_url":"https://api.github.com/users/starteam/events{/privacy}","received_events_url":"https://api.github.com/users/starteam/received_events","type":"Organization","site_admin":false},"repo":{"id":7005293,"name":"starcellbio_html","full_name":"starteam/starcellbio_html","owner":{"login":"starteam","id":2973496,"avatar_url":"https://avatars.githubusercontent.com/u/2973496?v=3","gravatar_id":"","url":"https://api.github.com/users/starteam","html_url":"https://github.com/starteam","followers_url":"https://api.github.com/users/starteam/followers","following_url":"https://api.github.com/users/starteam/following{/other_user}","gists_url":"https://api.github.com/users/starteam/gists{/gist_id}","starred_url":"https://api.github.com/users/starteam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/starteam/subscriptions","organizations_url":"https://api.github.com/users/starteam/orgs","repos_url":"https://api.github.com/users/starteam/repos","events_url":"https://api.github.com/users/starteam/events{/privacy}","received_events_url":"https://api.github.com/users/starteam/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/starteam/starcellbio_html","description":"","fork":false,"url":"https://api.github.com/repos/starteam/starcellbio_html","forks_url":"https://api.github.com/repos/starteam/starcellbio_html/forks","keys_url":"https://api.github.com/repos/starteam/starcellbio_html/keys{/key_id}","collaborators_url":"https://api.github.com/repos/starteam/starcellbio_html/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/starteam/starcellbio_html/teams","hooks_url":"https://api.github.com/repos/starteam/starcellbio_html/hooks","issue_events_url":"https://api.github.com/repos/starteam/starcellbio_html/issues/events{/number}","events_url":"https://api.github.com/repos/starteam/starcellbio_html/events","assignees_url":"https://api.github.com/repos/starteam/starcellbio_html/assignees{/user}","branches_url":"https://api.github.com/repos/starteam/starcellbio_html/branches{/branch}","tags_url":"https://api.github.com/repos/starteam/starcellbio_html/tags","blobs_url":"https://api.github.com/repos/starteam/starcellbio_html/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/starteam/starcellbio_html/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/starteam/starcellbio_html/git/refs{/sha}","trees_url":"https://api.github.com/repos/starteam/starcellbio_html/git/trees{/sha}","statuses_url":"https://api.github.com/repos/starteam/starcellbio_html/statuses/{sha}","languages_url":"https://api.github.com/repos/starteam/starcellbio_html/languages","stargazers_url":"https://api.github.com/repos/starteam/starcellbio_html/stargazers","contributors_url":"https://api.github.com/repos/starteam/starcellbio_html/contributors","subscribers_url":"https://api.github.com/repos/starteam/starcellbio_html/subscribers","subscription_url":"https://api.github.com/repos/starteam/starcellbio_html/subscription","commits_url":"https://api.github.com/repos/starteam/starcellbio_html/commits{/sha}","git_commits_url":"https://api.github.com/repos/starteam/starcellbio_html/git/commits{/sha}","comments_url":"https://api.github.com/repos/starteam/starcellbio_html/comments{/number}","issue_comment_url":"https://api.github.com/repos/starteam/starcellbio_html/issues/comments{/number}","contents_url":"https://api.github.com/repos/starteam/starcellbio_html/contents/{+path}","compare_url":"https://api.github.com/repos/starteam/starcellbio_html/compare/{base}...{head}","merges_url":"https://api.github.com/repos/starteam/starcellbio_html/merges","archive_url":"https://api.github.com/repos/starteam/starcellbio_html/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/starteam/starcellbio_html/downloads","issues_url":"https://api.github.com/repos/starteam/starcellbio_html/issues{/number}","pulls_url":"https://api.github.com/repos/starteam/starcellbio_html/pulls{/number}","milestones_url":"https://api.github.com/repos/starteam/starcellbio_html/milestones{/number}","notifications_url":"https://api.github.com/repos/starteam/starcellbio_html/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/starteam/starcellbio_html/labels{/name}","releases_url":"https://api.github.com/repos/starteam/starcellbio_html/releases{/id}","created_at":"2012-12-04T19:09:23Z","updated_at":"2015-04-15T21:42:40Z","pushed_at":"2015-04-22T21:01:02Z","git_url":"git://github.com/starteam/starcellbio_html.git","ssh_url":"git@github.com:starteam/starcellbio_html.git","clone_url":"https://github.com/starteam/starcellbio_html.git","svn_url":"https://github.com/starteam/starcellbio_html","homepage":null,"size":587466,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":67,"forks":6,"open_issues":67,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/starteam/starcellbio_html/pulls/178"},"html":{"href":"https://github.com/starteam/starcellbio_html/pull/178"},"issue":{"href":"https://api.github.com/repos/starteam/starcellbio_html/issues/178"},"comments":{"href":"https://api.github.com/repos/starteam/starcellbio_html/issues/178/comments"},"review_comments":{"href":"https://api.github.com/repos/starteam/starcellbio_html/pulls/178/comments"},"review_comment":{"href":"https://api.github.com/repos/starteam/starcellbio_html/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/starteam/starcellbio_html/pulls/178/commits"},"statuses":{"href":"https://api.github.com/repos/starteam/starcellbio_html/statuses/9dc8f6bb8f4c92f9153136b7886bcbc42f6f5d43"}}}}