{"action":"created","comment":{"url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/comments/30294894","id":30294894,"diff_hunk":"@@ -102,14 +107,26 @@ def get_all_announce(request, group_id):\n \n def detail(request, group_id):\n \n+    redirect_id = 1; #return to detail page.\n     group = get_group(group_id)\n     show_number = 5; #number for brief list to show in group detail page.\n-    all_contest = group.trace_contest.all()\n+    all_contest = group.trace_contest.order_by('-start_time')\n     annowence_list = group.announce.all()\n     student_list = group.member.order_by('user_level')\n     coowner_list = group.coowner.all()\n     owner = group.owner\n-    user_is_owner = has_group_ownership(request.user, group)\n+    form = AnnounceForm()\n+\n+    if not request.user.is_anonymous():\n+        user_is_owner = has_group_ownership(request.user, group)\n+        user_is_coowner = has_group_coownership(request.user, group)\n+        user_has_admin_auth = request.user.has_admin_auth()\n+    else: \n+        user_is_owner = False\n+        user_is_coowner = False\n+        user_has_admin_auth = False\n+    \n+    user_has_no_auth = not user_is_owner and not user_is_coowner","path":"group/views.py","position":63,"original_position":63,"commit_id":"bf8f4a6ad878e423478e5904b1d469895e3c7c09","original_commit_id":"bf8f4a6ad878e423478e5904b1d469895e3c7c09","user":{"login":"nickelcheng","id":10057984,"avatar_url":"https://avatars.githubusercontent.com/u/10057984?v=3","gravatar_id":"","url":"https://api.github.com/users/nickelcheng","html_url":"https://github.com/nickelcheng","followers_url":"https://api.github.com/users/nickelcheng/followers","following_url":"https://api.github.com/users/nickelcheng/following{/other_user}","gists_url":"https://api.github.com/users/nickelcheng/gists{/gist_id}","starred_url":"https://api.github.com/users/nickelcheng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nickelcheng/subscriptions","organizations_url":"https://api.github.com/users/nickelcheng/orgs","repos_url":"https://api.github.com/users/nickelcheng/repos","events_url":"https://api.github.com/users/nickelcheng/events{/privacy}","received_events_url":"https://api.github.com/users/nickelcheng/received_events","type":"User","site_admin":false},"body":"I wonder why do you use double not (```not user_is_owner``` and ```user_has_no_auth```)?\r\nI prefer ```user_has_auth = user_is_owner or user_is_coowner```","created_at":"2015-05-14T03:07:19Z","updated_at":"2015-05-14T03:07:19Z","html_url":"https://github.com/bruce3557/NTHUOJ_web/pull/189#discussion_r30294894","pull_request_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/189","_links":{"self":{"href":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/comments/30294894"},"html":{"href":"https://github.com/bruce3557/NTHUOJ_web/pull/189#discussion_r30294894"},"pull_request":{"href":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/189"}}},"pull_request":{"url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/189","id":35216619,"html_url":"https://github.com/bruce3557/NTHUOJ_web/pull/189","diff_url":"https://github.com/bruce3557/NTHUOJ_web/pull/189.diff","patch_url":"https://github.com/bruce3557/NTHUOJ_web/pull/189.patch","issue_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/issues/189","number":189,"state":"open","locked":false,"title":"Group Detail","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":"。正確顯示detail資訊(id, name, TA, traced contest, announcement, member)\r\n。正確顯示按鈕：edit announcement, view all announcement, view all contest, delete single member\r\n⋯⋯功能不包括在此PR\r\n。Announce相關功能已包括在此PR\r\n。 add member list, add single member .....不包括在此PR，將與增加member功能包在同個PR","created_at":"2015-05-12T11:24:48Z","updated_at":"2015-05-14T03:07:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9b94cf4f85dce247a72a7b0c69557c52393c837c","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/189/commits","review_comments_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/189/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/189/comments","statuses_url":"https://api.github.com/repos/bruce3557/NTHUOJ_web/statuses/bf8f4a6ad878e423478e5904b1d469895e3c7c09","head":{"label":"Casmo888:detail","ref":"detail","sha":"bf8f4a6ad878e423478e5904b1d469895e3c7c09","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":30700393,"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-02-12T11:56:37Z","updated_at":"2015-02-12T11:56:37Z","pushed_at":"2015-05-13T19:20:03Z","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":4013,"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":"77e68fd8c5991bcfe4bcd44c52acada6e2e0515f","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":"2015-05-07T06:09:16Z","pushed_at":"2015-05-13T19:20:03Z","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":6182,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":18,"forks":10,"open_issues":18,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/189"},"html":{"href":"https://github.com/bruce3557/NTHUOJ_web/pull/189"},"issue":{"href":"https://api.github.com/repos/bruce3557/NTHUOJ_web/issues/189"},"comments":{"href":"https://api.github.com/repos/bruce3557/NTHUOJ_web/issues/189/comments"},"review_comments":{"href":"https://api.github.com/repos/bruce3557/NTHUOJ_web/pulls/189/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/189/commits"},"statuses":{"href":"https://api.github.com/repos/bruce3557/NTHUOJ_web/statuses/bf8f4a6ad878e423478e5904b1d469895e3c7c09"}}}}