{"action":"created","comment":{"url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/comments/27767544","id":27767544,"diff_hunk":"@@ -0,0 +1,43 @@\n+'''\n+    The MIT License (MIT)\n+    Copyright (c) 2014 NTHUOJ team\n+    Permission is hereby granted, free of charge, to any person obtaining a copy\n+    of this software and associated documentation files (the \"Software\"), to deal\n+    in the Software without restriction, including without limitation the rights\n+    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n+    copies of the Software, and to permit persons to whom the Software is\n+    furnished to do so, subject to the following conditions:\n+    The above copyright notice and this permission notice shall be included in all\n+    copies or substantial portions of the Software.\n+    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n+    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n+    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n+    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n+    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n+    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n+    SOFTWARE.\n+    '''\n+from contest.models import Contest\n+from contest.models import Contestant\n+\n+from contest.contest_info import get_contest_or_404\n+from contest.contest_info import can_register\n+\n+from group.models import Group\n+\n+from utils.log_info import get_logger\n+\n+logger = get_logger()\n+\n+def register_user(contest, user):\n+    if can_register(contest, user):\n+        contestant = Contestant(contest = contest,user = user)","path":"contest/register_contest.py","position":34,"original_position":34,"commit_id":"8e1dea0b0f71e5bc94c54013ae8364635b797423","original_commit_id":"8e1dea0b0f71e5bc94c54013ae8364635b797423","user":{"login":"bruce3557","id":4061342,"avatar_url":"https://avatars.githubusercontent.com/u/4061342?v=3","gravatar_id":"","url":"https://api.github.com/users/bruce3557","html_url":"https://github.com/bruce3557","followers_url":"https://api.github.com/users/bruce3557/followers","following_url":"https://api.github.com/users/bruce3557/following{/other_user}","gists_url":"https://api.github.com/users/bruce3557/gists{/gist_id}","starred_url":"https://api.github.com/users/bruce3557/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bruce3557/subscriptions","organizations_url":"https://api.github.com/users/bruce3557/orgs","repos_url":"https://api.github.com/users/bruce3557/repos","events_url":"https://api.github.com/users/bruce3557/events{/privacy}","received_events_url":"https://api.github.com/users/bruce3557/received_events","type":"User","site_admin":false},"body":"add a space after ```,```","created_at":"2015-04-04T08:03:13Z","updated_at":"2015-04-04T08:03:13Z","html_url":"https://github.com/bruce3557/NTHUOJ_web/pull/83#discussion_r27767544","pull_request_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/83","_links":{"self":{"href":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/comments/27767544"},"html":{"href":"https://github.com/bruce3557/NTHUOJ_web/pull/83#discussion_r27767544"},"pull_request":{"href":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/83"}}},"pull_request":{"url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/83","id":31898581,"html_url":"https://github.com/bruce3557/NTHUOJ_web/pull/83","diff_url":"https://github.com/bruce3557/NTHUOJ_web/pull/83.diff","patch_url":"https://github.com/bruce3557/NTHUOJ_web/pull/83.patch","issue_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/issues/83","number":83,"state":"open","locked":false,"title":"Add group","user":{"login":"Changron","id":9431996,"avatar_url":"https://avatars.githubusercontent.com/u/9431996?v=3","gravatar_id":"","url":"https://api.github.com/users/Changron","html_url":"https://github.com/Changron","followers_url":"https://api.github.com/users/Changron/followers","following_url":"https://api.github.com/users/Changron/following{/other_user}","gists_url":"https://api.github.com/users/Changron/gists{/gist_id}","starred_url":"https://api.github.com/users/Changron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Changron/subscriptions","organizations_url":"https://api.github.com/users/Changron/orgs","repos_url":"https://api.github.com/users/Changron/repos","events_url":"https://api.github.com/users/Changron/events{/privacy}","received_events_url":"https://api.github.com/users/Changron/received_events","type":"User","site_admin":false},"body":"Can add group now\r\n![2015-03-31 11 00 46](https://cloud.githubusercontent.com/assets/9431996/6911602/3e44c87a-d795-11e4-8728-a7c429b38e4a.png)\r\n![2015-03-31 11 00 54](https://cloud.githubusercontent.com/assets/9431996/6911603/3fbb41a2-d795-11e4-8216-782b7b953b0a.png)\r\n","created_at":"2015-03-25T07:24:33Z","updated_at":"2015-04-04T08:03:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5fc120c5856343865a6a02d92c54d20f5bb6a123","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/83/commits","review_comments_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/83/comments","review_comment_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/issues/83/comments","statuses_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/statuses/8e1dea0b0f71e5bc94c54013ae8364635b797423","head":{"label":"Changron:add_group","ref":"add_group","sha":"8e1dea0b0f71e5bc94c54013ae8364635b797423","user":{"login":"Changron","id":9431996,"avatar_url":"https://avatars.githubusercontent.com/u/9431996?v=3","gravatar_id":"","url":"https://api.github.com/users/Changron","html_url":"https://github.com/Changron","followers_url":"https://api.github.com/users/Changron/followers","following_url":"https://api.github.com/users/Changron/following{/other_user}","gists_url":"https://api.github.com/users/Changron/gists{/gist_id}","starred_url":"https://api.github.com/users/Changron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Changron/subscriptions","organizations_url":"https://api.github.com/users/Changron/orgs","repos_url":"https://api.github.com/users/Changron/repos","events_url":"https://api.github.com/users/Changron/events{/privacy}","received_events_url":"https://api.github.com/users/Changron/received_events","type":"User","site_admin":false},"repo":{"id":27538510,"name":"NTHUOJ_web","full_name":"Changron/NTHUOJ_web","owner":{"login":"Changron","id":9431996,"avatar_url":"https://avatars.githubusercontent.com/u/9431996?v=3","gravatar_id":"","url":"https://api.github.com/users/Changron","html_url":"https://github.com/Changron","followers_url":"https://api.github.com/users/Changron/followers","following_url":"https://api.github.com/users/Changron/following{/other_user}","gists_url":"https://api.github.com/users/Changron/gists{/gist_id}","starred_url":"https://api.github.com/users/Changron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Changron/subscriptions","organizations_url":"https://api.github.com/users/Changron/orgs","repos_url":"https://api.github.com/users/Changron/repos","events_url":"https://api.github.com/users/Changron/events{/privacy}","received_events_url":"https://api.github.com/users/Changron/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Changron/NTHUOJ_web","description":"","fork":true,"url":"https://api.github.com/repos/Changron/NTHUOJ_web","forks_url":"https://api.github.com/repos/Changron/NTHUOJ_web/forks","keys_url":"https://api.github.com/repos/Changron/NTHUOJ_web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Changron/NTHUOJ_web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Changron/NTHUOJ_web/teams","hooks_url":"https://api.github.com/repos/Changron/NTHUOJ_web/hooks","issue_events_url":"https://api.github.com/repos/Changron/NTHUOJ_web/issues/events{/number}","events_url":"https://api.github.com/repos/Changron/NTHUOJ_web/events","assignees_url":"https://api.github.com/repos/Changron/NTHUOJ_web/assignees{/user}","branches_url":"https://api.github.com/repos/Changron/NTHUOJ_web/branches{/branch}","tags_url":"https://api.github.com/repos/Changron/NTHUOJ_web/tags","blobs_url":"https://api.github.com/repos/Changron/NTHUOJ_web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Changron/NTHUOJ_web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Changron/NTHUOJ_web/git/refs{/sha}","trees_url":"https://api.github.com/repos/Changron/NTHUOJ_web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Changron/NTHUOJ_web/statuses/{sha}","languages_url":"https://api.github.com/repos/Changron/NTHUOJ_web/languages","stargazers_url":"https://api.github.com/repos/Changron/NTHUOJ_web/stargazers","contributors_url":"https://api.github.com/repos/Changron/NTHUOJ_web/contributors","subscribers_url":"https://api.github.com/repos/Changron/NTHUOJ_web/subscribers","subscription_url":"https://api.github.com/repos/Changron/NTHUOJ_web/subscription","commits_url":"https://api.github.com/repos/Changron/NTHUOJ_web/commits{/sha}","git_commits_url":"https://api.github.com/repos/Changron/NTHUOJ_web/git/commits{/sha}","comments_url":"https://api.github.com/repos/Changron/NTHUOJ_web/comments{/number}","issue_comment_url":"https://api.github.com/repos/Changron/NTHUOJ_web/issues/comments{/number}","contents_url":"https://api.github.com/repos/Changron/NTHUOJ_web/contents/{+path}","compare_url":"https://api.github.com/repos/Changron/NTHUOJ_web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Changron/NTHUOJ_web/merges","archive_url":"https://api.github.com/repos/Changron/NTHUOJ_web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Changron/NTHUOJ_web/downloads","issues_url":"https://api.github.com/repos/Changron/NTHUOJ_web/issues{/number}","pulls_url":"https://api.github.com/repos/Changron/NTHUOJ_web/pulls{/number}","milestones_url":"https://api.github.com/repos/Changron/NTHUOJ_web/milestones{/number}","notifications_url":"https://api.github.com/repos/Changron/NTHUOJ_web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Changron/NTHUOJ_web/labels{/name}","releases_url":"https://api.github.com/repos/Changron/NTHUOJ_web/releases{/id}","created_at":"2014-12-04T12:00:39Z","updated_at":"2014-12-03T06:37:03Z","pushed_at":"2015-04-03T06:55:41Z","git_url":"git://github.com/Changron/NTHUOJ_web.git","ssh_url":"git@github.com:Changron/NTHUOJ_web.git","clone_url":"https://github.com/Changron/NTHUOJ_web.git","svn_url":"https://github.com/Changron/NTHUOJ_web","homepage":null,"size":3493,"stargazers_count":0,"watchers_count":0,"language":null,"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":"bruce3557:dev","ref":"dev","sha":"347fa0ddb7e50d331365867e35878d795377eeaa","user":{"login":"bruce3557","id":4061342,"avatar_url":"https://avatars.githubusercontent.com/u/4061342?v=3","gravatar_id":"","url":"https://api.github.com/users/bruce3557","html_url":"https://github.com/bruce3557","followers_url":"https://api.github.com/users/bruce3557/followers","following_url":"https://api.github.com/users/bruce3557/following{/other_user}","gists_url":"https://api.github.com/users/bruce3557/gists{/gist_id}","starred_url":"https://api.github.com/users/bruce3557/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bruce3557/subscriptions","organizations_url":"https://api.github.com/users/bruce3557/orgs","repos_url":"https://api.github.com/users/bruce3557/repos","events_url":"https://api.github.com/users/bruce3557/events{/privacy}","received_events_url":"https://api.github.com/users/bruce3557/received_events","type":"User","site_admin":false},"repo":{"id":27471538,"name":"NTHUOJ_web","full_name":"bruce3557/NTHUOJ_web","owner":{"login":"bruce3557","id":4061342,"avatar_url":"https://avatars.githubusercontent.com/u/4061342?v=3","gravatar_id":"","url":"https://api.github.com/users/bruce3557","html_url":"https://github.com/bruce3557","followers_url":"https://api.github.com/users/bruce3557/followers","following_url":"https://api.github.com/users/bruce3557/following{/other_user}","gists_url":"https://api.github.com/users/bruce3557/gists{/gist_id}","starred_url":"https://api.github.com/users/bruce3557/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bruce3557/subscriptions","organizations_url":"https://api.github.com/users/bruce3557/orgs","repos_url":"https://api.github.com/users/bruce3557/repos","events_url":"https://api.github.com/users/bruce3557/events{/privacy}","received_events_url":"https://api.github.com/users/bruce3557/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bruce3557/NTHUOJ_web","description":"","fork":false,"url":"https://api.github.com/repos/bruce3557/NTHUOJ_web","forks_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/forks","keys_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/teams","hooks_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/hooks","issue_events_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/issues/events{/number}","events_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/events","assignees_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/assignees{/user}","branches_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/branches{/branch}","tags_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/tags","blobs_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/git/refs{/sha}","trees_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/statuses/{sha}","languages_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/languages","stargazers_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/stargazers","contributors_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/contributors","subscribers_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/subscribers","subscription_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/subscription","commits_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/commits{/sha}","git_commits_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/git/commits{/sha}","comments_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/comments{/number}","issue_comment_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/issues/comments{/number}","contents_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/contents/{+path}","compare_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/merges","archive_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/downloads","issues_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/issues{/number}","pulls_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls{/number}","milestones_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/milestones{/number}","notifications_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/labels{/name}","releases_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/releases{/id}","created_at":"2014-12-03T05:45:27Z","updated_at":"2014-12-10T14:13:37Z","pushed_at":"2015-04-03T06:55:41Z","git_url":"git://github.com/bruce3557/NTHUOJ_web.git","ssh_url":"git@github.com:bruce3557/NTHUOJ_web.git","clone_url":"https://github.com/bruce3557/NTHUOJ_web.git","svn_url":"https://github.com/bruce3557/NTHUOJ_web","homepage":null,"size":4812,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":27,"forks":8,"open_issues":27,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/83"},"html":{"href":"https://github.com/bruce3557/NTHUOJ_web/pull/83"},"issue":{"href":"https://api.github.com/repos/bruce3557/NTHUOJ_web/issues/83"},"comments":{"href":"https://api.github.com/repos/bruce3557/NTHUOJ_web/issues/83/comments"},"review_comments":{"href":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/83/comments"},"review_comment":{"href":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/83/commits"},"statuses":{"href":"https://api.github.com/repos/bruce3557/NTHUOJ_web/statuses/8e1dea0b0f71e5bc94c54013ae8364635b797423"}}}}