{"action":"created","comment":{"url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/comments/24475912","id":24475912,"diff_hunk":"@@ -48,21 +46,18 @@ def get_running_contest(request):\n                 'list_type': 'runContest',\n             })\n \n-def get_ended_contest(request):\n-        all_ended_contest_list = [\n-            {'name':'archive', 'time':'20111010'},\n-            {'name':'archive', 'time':'20140505'},\n-            {'name':'archive', 'time':'20122222'},\n-            {'name':'archive', 'time':'20133333'},\n-            {'name':'archive', 'time':'20144444'},\n-            {'name':'archive', 'time':'20166666'},\n-            {'name':'archive', 'time':'20111010'},\n-            {'name':'archive', 'time':'20140505'},\n-            {'name':'archive', 'time':'20122222'},\n-            {'name':'archive', 'time':'20133333'},\n-            {'name':'archive', 'time':'20144444'},\n-            {'name':'archive', 'time':'20166666'},\n-        ] \n+def get_ended_contest(request, group_id):\n+        group = Group.objects.get(id = group_id)\n+        all_contest = group.trace_contest.all()\n+        all_ended_contest_list = []\n+        now = datetime.datetime.now()\n+\n+        for contest in all_contest:\n+            start_time = contest.end_time.replace(tzinfo=None)\n+            end_time = contest.start_time.replace(tzinfo=None)\n+            if start_time < now:","path":"group/views.py","position":70,"original_position":70,"commit_id":"c527b874bb7c9e24d9780cb51c02e05eb5592dd4","original_commit_id":"c527b874bb7c9e24d9780cb51c02e05eb5592dd4","user":{"login":"Casmo888","id":10060704,"avatar_url":"https://avatars.githubusercontent.com/u/10060704?v=3","gravatar_id":"","url":"https://api.github.com/users/Casmo888","html_url":"https://github.com/Casmo888","followers_url":"https://api.github.com/users/Casmo888/followers","following_url":"https://api.github.com/users/Casmo888/following{/other_user}","gists_url":"https://api.github.com/users/Casmo888/gists{/gist_id}","starred_url":"https://api.github.com/users/Casmo888/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Casmo888/subscriptions","organizations_url":"https://api.github.com/users/Casmo888/orgs","repos_url":"https://api.github.com/users/Casmo888/repos","events_url":"https://api.github.com/users/Casmo888/events{/privacy}","received_events_url":"https://api.github.com/users/Casmo888/received_events","type":"User","site_admin":false},"body":"Ditto\r\n","created_at":"2015-02-11T06:06:42Z","updated_at":"2015-02-11T06:06:42Z","html_url":"https://github.com/bruce3557/NTHUOJ_web/pull/37#discussion_r24475912","pull_request_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/37","_links":{"self":{"href":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/comments/24475912"},"html":{"href":"https://github.com/bruce3557/NTHUOJ_web/pull/37#discussion_r24475912"},"pull_request":{"href":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/37"}}},"pull_request":{"url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/37","id":28877140,"html_url":"https://github.com/bruce3557/NTHUOJ_web/pull/37","diff_url":"https://github.com/bruce3557/NTHUOJ_web/pull/37.diff","patch_url":"https://github.com/bruce3557/NTHUOJ_web/pull/37.patch","issue_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/issues/37","number":37,"state":"open","locked":false,"title":"Group part","user":{"login":"Casmo888","id":10060704,"avatar_url":"https://avatars.githubusercontent.com/u/10060704?v=3","gravatar_id":"","url":"https://api.github.com/users/Casmo888","html_url":"https://github.com/Casmo888","followers_url":"https://api.github.com/users/Casmo888/followers","following_url":"https://api.github.com/users/Casmo888/following{/other_user}","gists_url":"https://api.github.com/users/Casmo888/gists{/gist_id}","starred_url":"https://api.github.com/users/Casmo888/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Casmo888/subscriptions","organizations_url":"https://api.github.com/users/Casmo888/orgs","repos_url":"https://api.github.com/users/Casmo888/repos","events_url":"https://api.github.com/users/Casmo888/events{/privacy}","received_events_url":"https://api.github.com/users/Casmo888/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-08T07:55:36Z","updated_at":"2015-02-11T06:06:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6d586aa0ca26203f19fc7617e89a74e637f93a78","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/37/commits","review_comments_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/37/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/37/comments","statuses_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/statuses/c527b874bb7c9e24d9780cb51c02e05eb5592dd4","head":{"label":"Casmo888:dev","ref":"dev","sha":"c527b874bb7c9e24d9780cb51c02e05eb5592dd4","user":{"login":"Casmo888","id":10060704,"avatar_url":"https://avatars.githubusercontent.com/u/10060704?v=3","gravatar_id":"","url":"https://api.github.com/users/Casmo888","html_url":"https://github.com/Casmo888","followers_url":"https://api.github.com/users/Casmo888/followers","following_url":"https://api.github.com/users/Casmo888/following{/other_user}","gists_url":"https://api.github.com/users/Casmo888/gists{/gist_id}","starred_url":"https://api.github.com/users/Casmo888/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Casmo888/subscriptions","organizations_url":"https://api.github.com/users/Casmo888/orgs","repos_url":"https://api.github.com/users/Casmo888/repos","events_url":"https://api.github.com/users/Casmo888/events{/privacy}","received_events_url":"https://api.github.com/users/Casmo888/received_events","type":"User","site_admin":false},"repo":{"id":29950955,"name":"NTHUOJ_web","full_name":"Casmo888/NTHUOJ_web","owner":{"login":"Casmo888","id":10060704,"avatar_url":"https://avatars.githubusercontent.com/u/10060704?v=3","gravatar_id":"","url":"https://api.github.com/users/Casmo888","html_url":"https://github.com/Casmo888","followers_url":"https://api.github.com/users/Casmo888/followers","following_url":"https://api.github.com/users/Casmo888/following{/other_user}","gists_url":"https://api.github.com/users/Casmo888/gists{/gist_id}","starred_url":"https://api.github.com/users/Casmo888/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Casmo888/subscriptions","organizations_url":"https://api.github.com/users/Casmo888/orgs","repos_url":"https://api.github.com/users/Casmo888/repos","events_url":"https://api.github.com/users/Casmo888/events{/privacy}","received_events_url":"https://api.github.com/users/Casmo888/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Casmo888/NTHUOJ_web","description":"","fork":true,"url":"https://api.github.com/repos/Casmo888/NTHUOJ_web","forks_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/forks","keys_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/teams","hooks_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/hooks","issue_events_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/issues/events{/number}","events_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/events","assignees_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/assignees{/user}","branches_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/branches{/branch}","tags_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/tags","blobs_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/git/refs{/sha}","trees_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/statuses/{sha}","languages_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/languages","stargazers_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/stargazers","contributors_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/contributors","subscribers_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/subscribers","subscription_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/subscription","commits_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/commits{/sha}","git_commits_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/git/commits{/sha}","comments_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/comments{/number}","issue_comment_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/issues/comments/{number}","contents_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/contents/{+path}","compare_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/merges","archive_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/downloads","issues_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/issues{/number}","pulls_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/pulls{/number}","milestones_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/milestones{/number}","notifications_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/labels{/name}","releases_url":"https://api.github.com/repos/Casmo888/NTHUOJ_web/releases{/id}","created_at":"2015-01-28T04:43:27Z","updated_at":"2015-01-28T04:43:27Z","pushed_at":"2015-02-08T08:01:06Z","git_url":"git://github.com/Casmo888/NTHUOJ_web.git","ssh_url":"git@github.com:Casmo888/NTHUOJ_web.git","clone_url":"https://github.com/Casmo888/NTHUOJ_web.git","svn_url":"https://github.com/Casmo888/NTHUOJ_web","homepage":null,"size":2474,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"5a7a544f0c02d33e6beded9a88db0608c89ac6e6","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-02-09T15:11:16Z","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":3212,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":4,"forks":7,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/37"},"html":{"href":"https://github.com/bruce3557/NTHUOJ_web/pull/37"},"issue":{"href":"https://api.github.com/repos/bruce3557/NTHUOJ_web/issues/37"},"comments":{"href":"https://api.github.com/repos/bruce3557/NTHUOJ_web/issues/37/comments"},"review_comments":{"href":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/37/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/37/commits"},"statuses":{"href":"https://api.github.com/repos/bruce3557/NTHUOJ_web/statuses/c527b874bb7c9e24d9780cb51c02e05eb5592dd4"}}}}