{"action":"created","comment":{"url":"https://api.github.com/repos/go-gitea/gitea/pulls/comments/87147713","pull_request_review_id":7770607,"id":87147713,"diff_hunk":"@@ -298,12 +296,16 @@ func GetOwnedOrgsByUserIDDesc(userID int64, desc string) ([]*User, error) {\n // GetOrgUsersByUserID returns all organization-user relations by user ID.\n func GetOrgUsersByUserID(uid int64, all bool) ([]*OrgUser, error) {\n \tous := make([]*OrgUser, 0, 10)\n-\tsess := x.Where(\"uid=?\", uid)\n+\tsess := x.\n+\t\tJoin(\"LEFT\", \"user\", `\"org_user\".org_id=\"user\".id`).","path":"models/org.go","position":50,"original_position":50,"commit_id":"047eefc075ab2d70e9cb246e9a705c73c4b30d93","original_commit_id":"047eefc075ab2d70e9cb246e9a705c73c4b30d93","user":{"login":"0xbaadf00d","id":1005086,"avatar_url":"https://avatars.githubusercontent.com/u/1005086?v=3","gravatar_id":"","url":"https://api.github.com/users/0xbaadf00d","html_url":"https://github.com/0xbaadf00d","followers_url":"https://api.github.com/users/0xbaadf00d/followers","following_url":"https://api.github.com/users/0xbaadf00d/following{/other_user}","gists_url":"https://api.github.com/users/0xbaadf00d/gists{/gist_id}","starred_url":"https://api.github.com/users/0xbaadf00d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0xbaadf00d/subscriptions","organizations_url":"https://api.github.com/users/0xbaadf00d/orgs","repos_url":"https://api.github.com/users/0xbaadf00d/repos","events_url":"https://api.github.com/users/0xbaadf00d/events{/privacy}","received_events_url":"https://api.github.com/users/0xbaadf00d/received_events","type":"User","site_admin":false},"body":"Join is needed to order by Name","created_at":"2016-11-09T08:17:54Z","updated_at":"2016-11-09T08:17:54Z","html_url":"https://github.com/go-gitea/gitea/pull/49#discussion_r87147713","pull_request_url":"https://api.github.com/repos/go-gitea/gitea/pulls/49","_links":{"self":{"href":"https://api.github.com/repos/go-gitea/gitea/pulls/comments/87147713"},"html":{"href":"https://github.com/go-gitea/gitea/pull/49#discussion_r87147713"},"pull_request":{"href":"https://api.github.com/repos/go-gitea/gitea/pulls/49"}}},"pull_request":{"url":"https://api.github.com/repos/go-gitea/gitea/pulls/49","id":92179912,"html_url":"https://github.com/go-gitea/gitea/pull/49","diff_url":"https://github.com/go-gitea/gitea/pull/49.diff","patch_url":"https://github.com/go-gitea/gitea/pull/49.patch","issue_url":"https://api.github.com/repos/go-gitea/gitea/issues/49","number":49,"state":"open","locked":false,"title":"Ordering organizations and users by name","user":{"login":"0xbaadf00d","id":1005086,"avatar_url":"https://avatars.githubusercontent.com/u/1005086?v=3","gravatar_id":"","url":"https://api.github.com/users/0xbaadf00d","html_url":"https://github.com/0xbaadf00d","followers_url":"https://api.github.com/users/0xbaadf00d/followers","following_url":"https://api.github.com/users/0xbaadf00d/following{/other_user}","gists_url":"https://api.github.com/users/0xbaadf00d/gists{/gist_id}","starred_url":"https://api.github.com/users/0xbaadf00d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0xbaadf00d/subscriptions","organizations_url":"https://api.github.com/users/0xbaadf00d/orgs","repos_url":"https://api.github.com/users/0xbaadf00d/repos","events_url":"https://api.github.com/users/0xbaadf00d/events{/privacy}","received_events_url":"https://api.github.com/users/0xbaadf00d/received_events","type":"User","site_admin":false},"body":"Relative to the issue #3845, this Pull Request add modifications to ordering by name Organizations and User Accounts.\r\n\r\nIt's more user friendly and make search more easy when organizations and user accounts are ordered by name rather than last update datetime.\r\n\r\nI added new function `GetUsersByIDs` to decrease the number of SQL queries by using IN predicate rather than just running 1 SQL query per users.","created_at":"2016-11-03T15:40:03Z","updated_at":"2016-11-09T08:17:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c64125cdf36d6140e1ac576d6142e3a6bfcfe5b1","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/go-gitea/gitea/milestones/2","html_url":"https://github.com/go-gitea/gitea/milestones/1.1.0","labels_url":"https://api.github.com/repos/go-gitea/gitea/milestones/2/labels","id":2111550,"number":2,"title":"1.1.0","description":"","creator":{"login":"tboerger","id":156964,"avatar_url":"https://avatars.githubusercontent.com/u/156964?v=3","gravatar_id":"","url":"https://api.github.com/users/tboerger","html_url":"https://github.com/tboerger","followers_url":"https://api.github.com/users/tboerger/followers","following_url":"https://api.github.com/users/tboerger/following{/other_user}","gists_url":"https://api.github.com/users/tboerger/gists{/gist_id}","starred_url":"https://api.github.com/users/tboerger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tboerger/subscriptions","organizations_url":"https://api.github.com/users/tboerger/orgs","repos_url":"https://api.github.com/users/tboerger/repos","events_url":"https://api.github.com/users/tboerger/events{/privacy}","received_events_url":"https://api.github.com/users/tboerger/received_events","type":"User","site_admin":false},"open_issues":14,"closed_issues":0,"state":"open","created_at":"2016-11-03T08:40:10Z","updated_at":"2016-11-09T04:52:42Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/go-gitea/gitea/pulls/49/commits","review_comments_url":"https://api.github.com/repos/go-gitea/gitea/pulls/49/comments","review_comment_url":"https://api.github.com/repos/go-gitea/gitea/pulls/comments{/number}","comments_url":"https://api.github.com/repos/go-gitea/gitea/issues/49/comments","statuses_url":"https://api.github.com/repos/go-gitea/gitea/statuses/047eefc075ab2d70e9cb246e9a705c73c4b30d93","head":{"label":"0xbaadf00d:feature/3845-ordering-org-user","ref":"feature/3845-ordering-org-user","sha":"047eefc075ab2d70e9cb246e9a705c73c4b30d93","user":{"login":"0xbaadf00d","id":1005086,"avatar_url":"https://avatars.githubusercontent.com/u/1005086?v=3","gravatar_id":"","url":"https://api.github.com/users/0xbaadf00d","html_url":"https://github.com/0xbaadf00d","followers_url":"https://api.github.com/users/0xbaadf00d/followers","following_url":"https://api.github.com/users/0xbaadf00d/following{/other_user}","gists_url":"https://api.github.com/users/0xbaadf00d/gists{/gist_id}","starred_url":"https://api.github.com/users/0xbaadf00d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0xbaadf00d/subscriptions","organizations_url":"https://api.github.com/users/0xbaadf00d/orgs","repos_url":"https://api.github.com/users/0xbaadf00d/repos","events_url":"https://api.github.com/users/0xbaadf00d/events{/privacy}","received_events_url":"https://api.github.com/users/0xbaadf00d/received_events","type":"User","site_admin":false},"repo":{"id":64876352,"name":"gogs","full_name":"0xbaadf00d/gogs","owner":{"login":"0xbaadf00d","id":1005086,"avatar_url":"https://avatars.githubusercontent.com/u/1005086?v=3","gravatar_id":"","url":"https://api.github.com/users/0xbaadf00d","html_url":"https://github.com/0xbaadf00d","followers_url":"https://api.github.com/users/0xbaadf00d/followers","following_url":"https://api.github.com/users/0xbaadf00d/following{/other_user}","gists_url":"https://api.github.com/users/0xbaadf00d/gists{/gist_id}","starred_url":"https://api.github.com/users/0xbaadf00d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0xbaadf00d/subscriptions","organizations_url":"https://api.github.com/users/0xbaadf00d/orgs","repos_url":"https://api.github.com/users/0xbaadf00d/repos","events_url":"https://api.github.com/users/0xbaadf00d/events{/privacy}","received_events_url":"https://api.github.com/users/0xbaadf00d/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/0xbaadf00d/gogs","description":"Gogs (Go Git Service) is a painless self-hosted Git service.","fork":true,"url":"https://api.github.com/repos/0xbaadf00d/gogs","forks_url":"https://api.github.com/repos/0xbaadf00d/gogs/forks","keys_url":"https://api.github.com/repos/0xbaadf00d/gogs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/0xbaadf00d/gogs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/0xbaadf00d/gogs/teams","hooks_url":"https://api.github.com/repos/0xbaadf00d/gogs/hooks","issue_events_url":"https://api.github.com/repos/0xbaadf00d/gogs/issues/events{/number}","events_url":"https://api.github.com/repos/0xbaadf00d/gogs/events","assignees_url":"https://api.github.com/repos/0xbaadf00d/gogs/assignees{/user}","branches_url":"https://api.github.com/repos/0xbaadf00d/gogs/branches{/branch}","tags_url":"https://api.github.com/repos/0xbaadf00d/gogs/tags","blobs_url":"https://api.github.com/repos/0xbaadf00d/gogs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/0xbaadf00d/gogs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/0xbaadf00d/gogs/git/refs{/sha}","trees_url":"https://api.github.com/repos/0xbaadf00d/gogs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/0xbaadf00d/gogs/statuses/{sha}","languages_url":"https://api.github.com/repos/0xbaadf00d/gogs/languages","stargazers_url":"https://api.github.com/repos/0xbaadf00d/gogs/stargazers","contributors_url":"https://api.github.com/repos/0xbaadf00d/gogs/contributors","subscribers_url":"https://api.github.com/repos/0xbaadf00d/gogs/subscribers","subscription_url":"https://api.github.com/repos/0xbaadf00d/gogs/subscription","commits_url":"https://api.github.com/repos/0xbaadf00d/gogs/commits{/sha}","git_commits_url":"https://api.github.com/repos/0xbaadf00d/gogs/git/commits{/sha}","comments_url":"https://api.github.com/repos/0xbaadf00d/gogs/comments{/number}","issue_comment_url":"https://api.github.com/repos/0xbaadf00d/gogs/issues/comments{/number}","contents_url":"https://api.github.com/repos/0xbaadf00d/gogs/contents/{+path}","compare_url":"https://api.github.com/repos/0xbaadf00d/gogs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/0xbaadf00d/gogs/merges","archive_url":"https://api.github.com/repos/0xbaadf00d/gogs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/0xbaadf00d/gogs/downloads","issues_url":"https://api.github.com/repos/0xbaadf00d/gogs/issues{/number}","pulls_url":"https://api.github.com/repos/0xbaadf00d/gogs/pulls{/number}","milestones_url":"https://api.github.com/repos/0xbaadf00d/gogs/milestones{/number}","notifications_url":"https://api.github.com/repos/0xbaadf00d/gogs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/0xbaadf00d/gogs/labels{/name}","releases_url":"https://api.github.com/repos/0xbaadf00d/gogs/releases{/id}","deployments_url":"https://api.github.com/repos/0xbaadf00d/gogs/deployments","created_at":"2016-08-03T20:16:33Z","updated_at":"2016-10-30T20:35:03Z","pushed_at":"2016-11-06T09:12:04Z","git_url":"git://github.com/0xbaadf00d/gogs.git","ssh_url":"git@github.com:0xbaadf00d/gogs.git","clone_url":"https://github.com/0xbaadf00d/gogs.git","svn_url":"https://github.com/0xbaadf00d/gogs","homepage":"https://gogs.io","size":83279,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"go-gitea:master","ref":"master","sha":"a0e54c0512a764ab0f93eb2ee6b978fb736190b4","user":{"login":"go-gitea","id":12724356,"avatar_url":"https://avatars.githubusercontent.com/u/12724356?v=3","gravatar_id":"","url":"https://api.github.com/users/go-gitea","html_url":"https://github.com/go-gitea","followers_url":"https://api.github.com/users/go-gitea/followers","following_url":"https://api.github.com/users/go-gitea/following{/other_user}","gists_url":"https://api.github.com/users/go-gitea/gists{/gist_id}","starred_url":"https://api.github.com/users/go-gitea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/go-gitea/subscriptions","organizations_url":"https://api.github.com/users/go-gitea/orgs","repos_url":"https://api.github.com/users/go-gitea/repos","events_url":"https://api.github.com/users/go-gitea/events{/privacy}","received_events_url":"https://api.github.com/users/go-gitea/received_events","type":"Organization","site_admin":false},"repo":{"id":72495579,"name":"gitea","full_name":"go-gitea/gitea","owner":{"login":"go-gitea","id":12724356,"avatar_url":"https://avatars.githubusercontent.com/u/12724356?v=3","gravatar_id":"","url":"https://api.github.com/users/go-gitea","html_url":"https://github.com/go-gitea","followers_url":"https://api.github.com/users/go-gitea/followers","following_url":"https://api.github.com/users/go-gitea/following{/other_user}","gists_url":"https://api.github.com/users/go-gitea/gists{/gist_id}","starred_url":"https://api.github.com/users/go-gitea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/go-gitea/subscriptions","organizations_url":"https://api.github.com/users/go-gitea/orgs","repos_url":"https://api.github.com/users/go-gitea/repos","events_url":"https://api.github.com/users/go-gitea/events{/privacy}","received_events_url":"https://api.github.com/users/go-gitea/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/go-gitea/gitea","description":"Gitea: Git with a cup of tea","fork":true,"url":"https://api.github.com/repos/go-gitea/gitea","forks_url":"https://api.github.com/repos/go-gitea/gitea/forks","keys_url":"https://api.github.com/repos/go-gitea/gitea/keys{/key_id}","collaborators_url":"https://api.github.com/repos/go-gitea/gitea/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/go-gitea/gitea/teams","hooks_url":"https://api.github.com/repos/go-gitea/gitea/hooks","issue_events_url":"https://api.github.com/repos/go-gitea/gitea/issues/events{/number}","events_url":"https://api.github.com/repos/go-gitea/gitea/events","assignees_url":"https://api.github.com/repos/go-gitea/gitea/assignees{/user}","branches_url":"https://api.github.com/repos/go-gitea/gitea/branches{/branch}","tags_url":"https://api.github.com/repos/go-gitea/gitea/tags","blobs_url":"https://api.github.com/repos/go-gitea/gitea/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/go-gitea/gitea/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/go-gitea/gitea/git/refs{/sha}","trees_url":"https://api.github.com/repos/go-gitea/gitea/git/trees{/sha}","statuses_url":"https://api.github.com/repos/go-gitea/gitea/statuses/{sha}","languages_url":"https://api.github.com/repos/go-gitea/gitea/languages","stargazers_url":"https://api.github.com/repos/go-gitea/gitea/stargazers","contributors_url":"https://api.github.com/repos/go-gitea/gitea/contributors","subscribers_url":"https://api.github.com/repos/go-gitea/gitea/subscribers","subscription_url":"https://api.github.com/repos/go-gitea/gitea/subscription","commits_url":"https://api.github.com/repos/go-gitea/gitea/commits{/sha}","git_commits_url":"https://api.github.com/repos/go-gitea/gitea/git/commits{/sha}","comments_url":"https://api.github.com/repos/go-gitea/gitea/comments{/number}","issue_comment_url":"https://api.github.com/repos/go-gitea/gitea/issues/comments{/number}","contents_url":"https://api.github.com/repos/go-gitea/gitea/contents/{+path}","compare_url":"https://api.github.com/repos/go-gitea/gitea/compare/{base}...{head}","merges_url":"https://api.github.com/repos/go-gitea/gitea/merges","archive_url":"https://api.github.com/repos/go-gitea/gitea/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/go-gitea/gitea/downloads","issues_url":"https://api.github.com/repos/go-gitea/gitea/issues{/number}","pulls_url":"https://api.github.com/repos/go-gitea/gitea/pulls{/number}","milestones_url":"https://api.github.com/repos/go-gitea/gitea/milestones{/number}","notifications_url":"https://api.github.com/repos/go-gitea/gitea/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/go-gitea/gitea/labels{/name}","releases_url":"https://api.github.com/repos/go-gitea/gitea/releases{/id}","deployments_url":"https://api.github.com/repos/go-gitea/gitea/deployments","created_at":"2016-11-01T02:13:26Z","updated_at":"2016-11-08T20:49:44Z","pushed_at":"2016-11-09T07:16:27Z","git_url":"git://github.com/go-gitea/gitea.git","ssh_url":"git@github.com:go-gitea/gitea.git","clone_url":"https://github.com/go-gitea/gitea.git","svn_url":"https://github.com/go-gitea/gitea","homepage":"http://gitea.io","size":96622,"stargazers_count":51,"watchers_count":51,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":50,"forks":10,"open_issues":50,"watchers":51,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/go-gitea/gitea/pulls/49"},"html":{"href":"https://github.com/go-gitea/gitea/pull/49"},"issue":{"href":"https://api.github.com/repos/go-gitea/gitea/issues/49"},"comments":{"href":"https://api.github.com/repos/go-gitea/gitea/issues/49/comments"},"review_comments":{"href":"https://api.github.com/repos/go-gitea/gitea/pulls/49/comments"},"review_comment":{"href":"https://api.github.com/repos/go-gitea/gitea/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/go-gitea/gitea/pulls/49/commits"},"statuses":{"href":"https://api.github.com/repos/go-gitea/gitea/statuses/047eefc075ab2d70e9cb246e9a705c73c4b30d93"}}}}
{"actor":{"display_login":"0xbaadf00d"}}