{"action":"created","comment":{"url":"https://api.github.com/repos/CMPUT404/socialdistribution/pulls/comments/27239669","id":27239669,"diff_hunk":"@@ -155,13 +195,20 @@ class PublicPostsViewSet(\n     renderer_classes = (PostsJSONRenderer,)\n \n     def list(self, request):\n-        internal_posts = Post.objects.filter(visibility=\"PUBLIC\")\n-        serializer = PostSerializer(internal_posts, many=True)\n-        posts = serializer.data\n+        return Response(get_public_posts(self, request))\n+\n+\n+def get_public_posts(self, request):\n+    \"\"\"\n+    Returns a list of public posts based on APIUser type.\n+    \"\"\"\n+    internal_posts = Post.objects.filter(visibility=\"PUBLIC\")\n+    serializer = PostSerializer(internal_posts, many=True)\n+    posts = serializer.data\n \n-        # dont return public posts of other nodes in node-to-node calls\n-        if request.auth is None or request.user.type is not \"Node\":\n-            foreign_posts = Aggregator.get_public_posts()\n-            posts.extend(foreign_posts)\n+    # dont return public posts of other nodes in node-to-node calls\n+    if request.auth is None or request.user.type is not \"Node\":\n+        foreign_posts = Aggregator.get_public_posts()\n+        posts.extend(foreign_posts)\n \n-        return Response(posts)\n+    return posts","path":"api/views/content.py","position":122,"original_position":122,"commit_id":"6f31c13bf9d46655cd66c51e2dc8498455953c7b","original_commit_id":"6f31c13bf9d46655cd66c51e2dc8498455953c7b","user":{"login":"derekdowling","id":613964,"avatar_url":"https://avatars.githubusercontent.com/u/613964?v=3","gravatar_id":"","url":"https://api.github.com/users/derekdowling","html_url":"https://github.com/derekdowling","followers_url":"https://api.github.com/users/derekdowling/followers","following_url":"https://api.github.com/users/derekdowling/following{/other_user}","gists_url":"https://api.github.com/users/derekdowling/gists{/gist_id}","starred_url":"https://api.github.com/users/derekdowling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derekdowling/subscriptions","organizations_url":"https://api.github.com/users/derekdowling/orgs","repos_url":"https://api.github.com/users/derekdowling/repos","events_url":"https://api.github.com/users/derekdowling/events{/privacy}","received_events_url":"https://api.github.com/users/derekdowling/received_events","type":"User","site_admin":false},"body":"Smushed the separated function back into the view. I'm just going to pull out the JSONRendered because it's confusing.","created_at":"2015-03-26T18:07:32Z","updated_at":"2015-03-26T18:07:32Z","html_url":"https://github.com/CMPUT404/socialdistribution/pull/152#discussion_r27239669","pull_request_url":"https://api.github.com/repos/CMPUT404/socialdistribution/pulls/152","_links":{"self":{"href":"https://api.github.com/repos/CMPUT404/socialdistribution/pulls/comments/27239669"},"html":{"href":"https://github.com/CMPUT404/socialdistribution/pull/152#discussion_r27239669"},"pull_request":{"href":"https://api.github.com/repos/CMPUT404/socialdistribution/pulls/152"}}},"pull_request":{"url":"https://api.github.com/repos/CMPUT404/socialdistribution/pulls/152","id":31980537,"html_url":"https://github.com/CMPUT404/socialdistribution/pull/152","diff_url":"https://github.com/CMPUT404/socialdistribution/pull/152.diff","patch_url":"https://github.com/CMPUT404/socialdistribution/pull/152.patch","issue_url":"https://api.github.com/repos/CMPUT404/socialdistribution/issues/152","number":152,"state":"open","locked":false,"title":"Basic machinery to put timeline together","user":{"login":"derekdowling","id":613964,"avatar_url":"https://avatars.githubusercontent.com/u/613964?v=3","gravatar_id":"","url":"https://api.github.com/users/derekdowling","html_url":"https://github.com/derekdowling","followers_url":"https://api.github.com/users/derekdowling/followers","following_url":"https://api.github.com/users/derekdowling/following{/other_user}","gists_url":"https://api.github.com/users/derekdowling/gists{/gist_id}","starred_url":"https://api.github.com/users/derekdowling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derekdowling/subscriptions","organizations_url":"https://api.github.com/users/derekdowling/orgs","repos_url":"https://api.github.com/users/derekdowling/repos","events_url":"https://api.github.com/users/derekdowling/events{/privacy}","received_events_url":"https://api.github.com/users/derekdowling/received_events","type":"User","site_admin":false},"body":"Includes a test suite for testing integrations of:\r\n- timeline\r\n- public posts\r\n- author view\r\n- author posts\r\n- friends\r\n\r\nWith relevant hooks for all except author posts so far but we probably won't be calling this one.","created_at":"2015-03-26T00:48:47Z","updated_at":"2015-03-26T18:07:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5c8751e7f2353e345669d9fc9e306a158d3c670f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CMPUT404/socialdistribution/pulls/152/commits","review_comments_url":"https://api.github.com/repos/CMPUT404/socialdistribution/pulls/152/comments","review_comment_url":"https://api.github.com/repos/CMPUT404/socialdistribution/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CMPUT404/socialdistribution/issues/152/comments","statuses_url":"https://api.github.com/repos/CMPUT404/socialdistribution/statuses/6f31c13bf9d46655cd66c51e2dc8498455953c7b","head":{"label":"CMPUT404:timeline-aggregation","ref":"timeline-aggregation","sha":"6f31c13bf9d46655cd66c51e2dc8498455953c7b","user":{"login":"CMPUT404","id":10713091,"avatar_url":"https://avatars.githubusercontent.com/u/10713091?v=3","gravatar_id":"","url":"https://api.github.com/users/CMPUT404","html_url":"https://github.com/CMPUT404","followers_url":"https://api.github.com/users/CMPUT404/followers","following_url":"https://api.github.com/users/CMPUT404/following{/other_user}","gists_url":"https://api.github.com/users/CMPUT404/gists{/gist_id}","starred_url":"https://api.github.com/users/CMPUT404/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CMPUT404/subscriptions","organizations_url":"https://api.github.com/users/CMPUT404/orgs","repos_url":"https://api.github.com/users/CMPUT404/repos","events_url":"https://api.github.com/users/CMPUT404/events{/privacy}","received_events_url":"https://api.github.com/users/CMPUT404/received_events","type":"Organization","site_admin":false},"repo":{"id":29875255,"name":"socialdistribution","full_name":"CMPUT404/socialdistribution","owner":{"login":"CMPUT404","id":10713091,"avatar_url":"https://avatars.githubusercontent.com/u/10713091?v=3","gravatar_id":"","url":"https://api.github.com/users/CMPUT404","html_url":"https://github.com/CMPUT404","followers_url":"https://api.github.com/users/CMPUT404/followers","following_url":"https://api.github.com/users/CMPUT404/following{/other_user}","gists_url":"https://api.github.com/users/CMPUT404/gists{/gist_id}","starred_url":"https://api.github.com/users/CMPUT404/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CMPUT404/subscriptions","organizations_url":"https://api.github.com/users/CMPUT404/orgs","repos_url":"https://api.github.com/users/CMPUT404/repos","events_url":"https://api.github.com/users/CMPUT404/events{/privacy}","received_events_url":"https://api.github.com/users/CMPUT404/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CMPUT404/socialdistribution","description":"A distributed social network","fork":false,"url":"https://api.github.com/repos/CMPUT404/socialdistribution","forks_url":"https://api.github.com/repos/CMPUT404/socialdistribution/forks","keys_url":"https://api.github.com/repos/CMPUT404/socialdistribution/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CMPUT404/socialdistribution/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CMPUT404/socialdistribution/teams","hooks_url":"https://api.github.com/repos/CMPUT404/socialdistribution/hooks","issue_events_url":"https://api.github.com/repos/CMPUT404/socialdistribution/issues/events{/number}","events_url":"https://api.github.com/repos/CMPUT404/socialdistribution/events","assignees_url":"https://api.github.com/repos/CMPUT404/socialdistribution/assignees{/user}","branches_url":"https://api.github.com/repos/CMPUT404/socialdistribution/branches{/branch}","tags_url":"https://api.github.com/repos/CMPUT404/socialdistribution/tags","blobs_url":"https://api.github.com/repos/CMPUT404/socialdistribution/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CMPUT404/socialdistribution/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CMPUT404/socialdistribution/git/refs{/sha}","trees_url":"https://api.github.com/repos/CMPUT404/socialdistribution/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CMPUT404/socialdistribution/statuses/{sha}","languages_url":"https://api.github.com/repos/CMPUT404/socialdistribution/languages","stargazers_url":"https://api.github.com/repos/CMPUT404/socialdistribution/stargazers","contributors_url":"https://api.github.com/repos/CMPUT404/socialdistribution/contributors","subscribers_url":"https://api.github.com/repos/CMPUT404/socialdistribution/subscribers","subscription_url":"https://api.github.com/repos/CMPUT404/socialdistribution/subscription","commits_url":"https://api.github.com/repos/CMPUT404/socialdistribution/commits{/sha}","git_commits_url":"https://api.github.com/repos/CMPUT404/socialdistribution/git/commits{/sha}","comments_url":"https://api.github.com/repos/CMPUT404/socialdistribution/comments{/number}","issue_comment_url":"https://api.github.com/repos/CMPUT404/socialdistribution/issues/comments{/number}","contents_url":"https://api.github.com/repos/CMPUT404/socialdistribution/contents/{+path}","compare_url":"https://api.github.com/repos/CMPUT404/socialdistribution/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CMPUT404/socialdistribution/merges","archive_url":"https://api.github.com/repos/CMPUT404/socialdistribution/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CMPUT404/socialdistribution/downloads","issues_url":"https://api.github.com/repos/CMPUT404/socialdistribution/issues{/number}","pulls_url":"https://api.github.com/repos/CMPUT404/socialdistribution/pulls{/number}","milestones_url":"https://api.github.com/repos/CMPUT404/socialdistribution/milestones{/number}","notifications_url":"https://api.github.com/repos/CMPUT404/socialdistribution/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CMPUT404/socialdistribution/labels{/name}","releases_url":"https://api.github.com/repos/CMPUT404/socialdistribution/releases{/id}","created_at":"2015-01-26T18:32:01Z","updated_at":"2015-03-26T16:34:33Z","pushed_at":"2015-03-26T17:50:45Z","git_url":"git://github.com/CMPUT404/socialdistribution.git","ssh_url":"git@github.com:CMPUT404/socialdistribution.git","clone_url":"https://github.com/CMPUT404/socialdistribution.git","svn_url":"https://github.com/CMPUT404/socialdistribution","homepage":null,"size":2120,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":18,"forks":0,"open_issues":18,"watchers":0,"default_branch":"master"}},"base":{"label":"CMPUT404:master","ref":"master","sha":"afc2b6b4bcb9f29fd72c9ac09ea67473ed885c9f","user":{"login":"CMPUT404","id":10713091,"avatar_url":"https://avatars.githubusercontent.com/u/10713091?v=3","gravatar_id":"","url":"https://api.github.com/users/CMPUT404","html_url":"https://github.com/CMPUT404","followers_url":"https://api.github.com/users/CMPUT404/followers","following_url":"https://api.github.com/users/CMPUT404/following{/other_user}","gists_url":"https://api.github.com/users/CMPUT404/gists{/gist_id}","starred_url":"https://api.github.com/users/CMPUT404/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CMPUT404/subscriptions","organizations_url":"https://api.github.com/users/CMPUT404/orgs","repos_url":"https://api.github.com/users/CMPUT404/repos","events_url":"https://api.github.com/users/CMPUT404/events{/privacy}","received_events_url":"https://api.github.com/users/CMPUT404/received_events","type":"Organization","site_admin":false},"repo":{"id":29875255,"name":"socialdistribution","full_name":"CMPUT404/socialdistribution","owner":{"login":"CMPUT404","id":10713091,"avatar_url":"https://avatars.githubusercontent.com/u/10713091?v=3","gravatar_id":"","url":"https://api.github.com/users/CMPUT404","html_url":"https://github.com/CMPUT404","followers_url":"https://api.github.com/users/CMPUT404/followers","following_url":"https://api.github.com/users/CMPUT404/following{/other_user}","gists_url":"https://api.github.com/users/CMPUT404/gists{/gist_id}","starred_url":"https://api.github.com/users/CMPUT404/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CMPUT404/subscriptions","organizations_url":"https://api.github.com/users/CMPUT404/orgs","repos_url":"https://api.github.com/users/CMPUT404/repos","events_url":"https://api.github.com/users/CMPUT404/events{/privacy}","received_events_url":"https://api.github.com/users/CMPUT404/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CMPUT404/socialdistribution","description":"A distributed social network","fork":false,"url":"https://api.github.com/repos/CMPUT404/socialdistribution","forks_url":"https://api.github.com/repos/CMPUT404/socialdistribution/forks","keys_url":"https://api.github.com/repos/CMPUT404/socialdistribution/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CMPUT404/socialdistribution/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CMPUT404/socialdistribution/teams","hooks_url":"https://api.github.com/repos/CMPUT404/socialdistribution/hooks","issue_events_url":"https://api.github.com/repos/CMPUT404/socialdistribution/issues/events{/number}","events_url":"https://api.github.com/repos/CMPUT404/socialdistribution/events","assignees_url":"https://api.github.com/repos/CMPUT404/socialdistribution/assignees{/user}","branches_url":"https://api.github.com/repos/CMPUT404/socialdistribution/branches{/branch}","tags_url":"https://api.github.com/repos/CMPUT404/socialdistribution/tags","blobs_url":"https://api.github.com/repos/CMPUT404/socialdistribution/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CMPUT404/socialdistribution/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CMPUT404/socialdistribution/git/refs{/sha}","trees_url":"https://api.github.com/repos/CMPUT404/socialdistribution/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CMPUT404/socialdistribution/statuses/{sha}","languages_url":"https://api.github.com/repos/CMPUT404/socialdistribution/languages","stargazers_url":"https://api.github.com/repos/CMPUT404/socialdistribution/stargazers","contributors_url":"https://api.github.com/repos/CMPUT404/socialdistribution/contributors","subscribers_url":"https://api.github.com/repos/CMPUT404/socialdistribution/subscribers","subscription_url":"https://api.github.com/repos/CMPUT404/socialdistribution/subscription","commits_url":"https://api.github.com/repos/CMPUT404/socialdistribution/commits{/sha}","git_commits_url":"https://api.github.com/repos/CMPUT404/socialdistribution/git/commits{/sha}","comments_url":"https://api.github.com/repos/CMPUT404/socialdistribution/comments{/number}","issue_comment_url":"https://api.github.com/repos/CMPUT404/socialdistribution/issues/comments{/number}","contents_url":"https://api.github.com/repos/CMPUT404/socialdistribution/contents/{+path}","compare_url":"https://api.github.com/repos/CMPUT404/socialdistribution/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CMPUT404/socialdistribution/merges","archive_url":"https://api.github.com/repos/CMPUT404/socialdistribution/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CMPUT404/socialdistribution/downloads","issues_url":"https://api.github.com/repos/CMPUT404/socialdistribution/issues{/number}","pulls_url":"https://api.github.com/repos/CMPUT404/socialdistribution/pulls{/number}","milestones_url":"https://api.github.com/repos/CMPUT404/socialdistribution/milestones{/number}","notifications_url":"https://api.github.com/repos/CMPUT404/socialdistribution/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CMPUT404/socialdistribution/labels{/name}","releases_url":"https://api.github.com/repos/CMPUT404/socialdistribution/releases{/id}","created_at":"2015-01-26T18:32:01Z","updated_at":"2015-03-26T16:34:33Z","pushed_at":"2015-03-26T17:50:45Z","git_url":"git://github.com/CMPUT404/socialdistribution.git","ssh_url":"git@github.com:CMPUT404/socialdistribution.git","clone_url":"https://github.com/CMPUT404/socialdistribution.git","svn_url":"https://github.com/CMPUT404/socialdistribution","homepage":null,"size":2120,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":18,"forks":0,"open_issues":18,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CMPUT404/socialdistribution/pulls/152"},"html":{"href":"https://github.com/CMPUT404/socialdistribution/pull/152"},"issue":{"href":"https://api.github.com/repos/CMPUT404/socialdistribution/issues/152"},"comments":{"href":"https://api.github.com/repos/CMPUT404/socialdistribution/issues/152/comments"},"review_comments":{"href":"https://api.github.com/repos/CMPUT404/socialdistribution/pulls/152/comments"},"review_comment":{"href":"https://api.github.com/repos/CMPUT404/socialdistribution/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CMPUT404/socialdistribution/pulls/152/commits"},"statuses":{"href":"https://api.github.com/repos/CMPUT404/socialdistribution/statuses/6f31c13bf9d46655cd66c51e2dc8498455953c7b"}}}}