{"action":"created","comment":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments/64261062","id":64261062,"diff_hunk":"@@ -358,6 +358,16 @@ def test_node_files_are_filterable_by_kind(self):\n         assert_equal(len(res.json['data']), 1)  # filters out 'xyz'\n         assert_equal(res.json['data'][0]['attributes']['name'], 'abc')\n \n+    def test_node_files_are_filterable_by_size(self):\n+        self.file = api_utils.create_test_file_for_size_filter(self.project, self.user)\n+\n+        url = '/{}nodes/{}/files/osfstorage/?filter[size]=123'.format(API_BASE, self.project._id,)\n+        res = self.app.get(url, auth=self.user.auth)\n+        print(res)\n+        assert_equal(res.status_code, 200)\n+        assert_equal(res.json['data'][0]['attributes']['name'], 'test_file')\n+        assert_equal(res.json['data'][0]['attributes']['size'], 123)","path":"api_tests/nodes/views/test_node_files_list.py","position":12,"original_position":12,"commit_id":"ff2ba1727e43e637e6d9fb6876a75479f3bfdba3","original_commit_id":"ff2ba1727e43e637e6d9fb6876a75479f3bfdba3","user":{"login":"brianjgeiger","id":6599111,"avatar_url":"https://avatars.githubusercontent.com/u/6599111?v=3","gravatar_id":"","url":"https://api.github.com/users/brianjgeiger","html_url":"https://github.com/brianjgeiger","followers_url":"https://api.github.com/users/brianjgeiger/followers","following_url":"https://api.github.com/users/brianjgeiger/following{/other_user}","gists_url":"https://api.github.com/users/brianjgeiger/gists{/gist_id}","starred_url":"https://api.github.com/users/brianjgeiger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brianjgeiger/subscriptions","organizations_url":"https://api.github.com/users/brianjgeiger/orgs","repos_url":"https://api.github.com/users/brianjgeiger/repos","events_url":"https://api.github.com/users/brianjgeiger/events{/privacy}","received_events_url":"https://api.github.com/users/brianjgeiger/received_events","type":"User","site_admin":false},"body":"Can you get the size off of self.file directly rather than using `123`? The problem is that someone could change the size in the helper function and then the test would fail.","created_at":"2016-05-23T18:05:20Z","updated_at":"2016-05-23T18:05:20Z","html_url":"https://github.com/CenterForOpenScience/osf.io/pull/5715#discussion_r64261062","pull_request_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5715","_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments/64261062"},"html":{"href":"https://github.com/CenterForOpenScience/osf.io/pull/5715#discussion_r64261062"},"pull_request":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5715"}}},"pull_request":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5715","id":71084626,"html_url":"https://github.com/CenterForOpenScience/osf.io/pull/5715","diff_url":"https://github.com/CenterForOpenScience/osf.io/pull/5715.diff","patch_url":"https://github.com/CenterForOpenScience/osf.io/pull/5715.patch","issue_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/5715","number":5715,"state":"open","locked":false,"title":"API V2 Node file list filtering by size not working [OSF-4948]","user":{"login":"adlius","id":1566880,"avatar_url":"https://avatars.githubusercontent.com/u/1566880?v=3","gravatar_id":"","url":"https://api.github.com/users/adlius","html_url":"https://github.com/adlius","followers_url":"https://api.github.com/users/adlius/followers","following_url":"https://api.github.com/users/adlius/following{/other_user}","gists_url":"https://api.github.com/users/adlius/gists{/gist_id}","starred_url":"https://api.github.com/users/adlius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adlius/subscriptions","organizations_url":"https://api.github.com/users/adlius/orgs","repos_url":"https://api.github.com/users/adlius/repos","events_url":"https://api.github.com/users/adlius/events{/privacy}","received_events_url":"https://api.github.com/users/adlius/received_events","type":"User","site_admin":false},"body":"## Purpose\r\nThis PR fix the problem of API V2 not being able to filter by size of the file\r\n\r\n## Changes\r\nThe root cause of this bug is that when the user tries to query by filesize, a parameter is passed through the url. In filters.py, the parameter passed by the url is read as a string, instead of an int, thus causing the filter function \"get_filtered_queryset()\" not being able to match by size as size should be an int. Change is made to convert the parameter from string to int.\r\n\r\nIn addition, one unit test and a helper method for the unit test is added to verify filtering by size works.\r\n\r\n## Side effects\r\nNone\r\n\r\n## Ticket\r\nhttps://openscience.atlassian.net/browse/OSF-4948\r\n","created_at":"2016-05-23T17:06:05Z","updated_at":"2016-05-23T18:05:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"500f6185dbfb4e3ad6a0ca51c383c44577dab279","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5715/commits","review_comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5715/comments","review_comment_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/5715/comments","statuses_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/ff2ba1727e43e637e6d9fb6876a75479f3bfdba3","head":{"label":"adlius:osf4948","ref":"osf4948","sha":"ff2ba1727e43e637e6d9fb6876a75479f3bfdba3","user":{"login":"adlius","id":1566880,"avatar_url":"https://avatars.githubusercontent.com/u/1566880?v=3","gravatar_id":"","url":"https://api.github.com/users/adlius","html_url":"https://github.com/adlius","followers_url":"https://api.github.com/users/adlius/followers","following_url":"https://api.github.com/users/adlius/following{/other_user}","gists_url":"https://api.github.com/users/adlius/gists{/gist_id}","starred_url":"https://api.github.com/users/adlius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adlius/subscriptions","organizations_url":"https://api.github.com/users/adlius/orgs","repos_url":"https://api.github.com/users/adlius/repos","events_url":"https://api.github.com/users/adlius/events{/privacy}","received_events_url":"https://api.github.com/users/adlius/received_events","type":"User","site_admin":false},"repo":{"id":52629554,"name":"osf.io","full_name":"adlius/osf.io","owner":{"login":"adlius","id":1566880,"avatar_url":"https://avatars.githubusercontent.com/u/1566880?v=3","gravatar_id":"","url":"https://api.github.com/users/adlius","html_url":"https://github.com/adlius","followers_url":"https://api.github.com/users/adlius/followers","following_url":"https://api.github.com/users/adlius/following{/other_user}","gists_url":"https://api.github.com/users/adlius/gists{/gist_id}","starred_url":"https://api.github.com/users/adlius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adlius/subscriptions","organizations_url":"https://api.github.com/users/adlius/orgs","repos_url":"https://api.github.com/users/adlius/repos","events_url":"https://api.github.com/users/adlius/events{/privacy}","received_events_url":"https://api.github.com/users/adlius/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/adlius/osf.io","description":"Facilitating Open Science","fork":true,"url":"https://api.github.com/repos/adlius/osf.io","forks_url":"https://api.github.com/repos/adlius/osf.io/forks","keys_url":"https://api.github.com/repos/adlius/osf.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adlius/osf.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adlius/osf.io/teams","hooks_url":"https://api.github.com/repos/adlius/osf.io/hooks","issue_events_url":"https://api.github.com/repos/adlius/osf.io/issues/events{/number}","events_url":"https://api.github.com/repos/adlius/osf.io/events","assignees_url":"https://api.github.com/repos/adlius/osf.io/assignees{/user}","branches_url":"https://api.github.com/repos/adlius/osf.io/branches{/branch}","tags_url":"https://api.github.com/repos/adlius/osf.io/tags","blobs_url":"https://api.github.com/repos/adlius/osf.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adlius/osf.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adlius/osf.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/adlius/osf.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adlius/osf.io/statuses/{sha}","languages_url":"https://api.github.com/repos/adlius/osf.io/languages","stargazers_url":"https://api.github.com/repos/adlius/osf.io/stargazers","contributors_url":"https://api.github.com/repos/adlius/osf.io/contributors","subscribers_url":"https://api.github.com/repos/adlius/osf.io/subscribers","subscription_url":"https://api.github.com/repos/adlius/osf.io/subscription","commits_url":"https://api.github.com/repos/adlius/osf.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/adlius/osf.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/adlius/osf.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/adlius/osf.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/adlius/osf.io/contents/{+path}","compare_url":"https://api.github.com/repos/adlius/osf.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adlius/osf.io/merges","archive_url":"https://api.github.com/repos/adlius/osf.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adlius/osf.io/downloads","issues_url":"https://api.github.com/repos/adlius/osf.io/issues{/number}","pulls_url":"https://api.github.com/repos/adlius/osf.io/pulls{/number}","milestones_url":"https://api.github.com/repos/adlius/osf.io/milestones{/number}","notifications_url":"https://api.github.com/repos/adlius/osf.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adlius/osf.io/labels{/name}","releases_url":"https://api.github.com/repos/adlius/osf.io/releases{/id}","deployments_url":"https://api.github.com/repos/adlius/osf.io/deployments","created_at":"2016-02-26T20:05:25Z","updated_at":"2016-02-26T20:05:31Z","pushed_at":"2016-05-23T17:47:20Z","git_url":"git://github.com/adlius/osf.io.git","ssh_url":"git@github.com:adlius/osf.io.git","clone_url":"https://github.com/adlius/osf.io.git","svn_url":"https://github.com/adlius/osf.io","homepage":"http://osf.io","size":130540,"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":"develop"}},"base":{"label":"CenterForOpenScience:develop","ref":"develop","sha":"52bcfdf47bc6f6729234a4eb65f06d187f8f5142","user":{"login":"CenterForOpenScience","id":3344584,"avatar_url":"https://avatars.githubusercontent.com/u/3344584?v=3","gravatar_id":"","url":"https://api.github.com/users/CenterForOpenScience","html_url":"https://github.com/CenterForOpenScience","followers_url":"https://api.github.com/users/CenterForOpenScience/followers","following_url":"https://api.github.com/users/CenterForOpenScience/following{/other_user}","gists_url":"https://api.github.com/users/CenterForOpenScience/gists{/gist_id}","starred_url":"https://api.github.com/users/CenterForOpenScience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CenterForOpenScience/subscriptions","organizations_url":"https://api.github.com/users/CenterForOpenScience/orgs","repos_url":"https://api.github.com/users/CenterForOpenScience/repos","events_url":"https://api.github.com/users/CenterForOpenScience/events{/privacy}","received_events_url":"https://api.github.com/users/CenterForOpenScience/received_events","type":"Organization","site_admin":false},"repo":{"id":10199599,"name":"osf.io","full_name":"CenterForOpenScience/osf.io","owner":{"login":"CenterForOpenScience","id":3344584,"avatar_url":"https://avatars.githubusercontent.com/u/3344584?v=3","gravatar_id":"","url":"https://api.github.com/users/CenterForOpenScience","html_url":"https://github.com/CenterForOpenScience","followers_url":"https://api.github.com/users/CenterForOpenScience/followers","following_url":"https://api.github.com/users/CenterForOpenScience/following{/other_user}","gists_url":"https://api.github.com/users/CenterForOpenScience/gists{/gist_id}","starred_url":"https://api.github.com/users/CenterForOpenScience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CenterForOpenScience/subscriptions","organizations_url":"https://api.github.com/users/CenterForOpenScience/orgs","repos_url":"https://api.github.com/users/CenterForOpenScience/repos","events_url":"https://api.github.com/users/CenterForOpenScience/events{/privacy}","received_events_url":"https://api.github.com/users/CenterForOpenScience/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CenterForOpenScience/osf.io","description":"Facilitating Open Science","fork":false,"url":"https://api.github.com/repos/CenterForOpenScience/osf.io","forks_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/forks","keys_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/teams","hooks_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/hooks","issue_events_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/events{/number}","events_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/events","assignees_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/assignees{/user}","branches_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/branches{/branch}","tags_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/tags","blobs_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/{sha}","languages_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/languages","stargazers_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/stargazers","contributors_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/contributors","subscribers_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/subscribers","subscription_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/subscription","commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/contents/{+path}","compare_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/merges","archive_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/downloads","issues_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues{/number}","pulls_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls{/number}","milestones_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/milestones{/number}","notifications_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/labels{/name}","releases_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/releases{/id}","deployments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/deployments","created_at":"2013-05-21T15:53:37Z","updated_at":"2016-05-23T17:42:46Z","pushed_at":"2016-05-23T17:59:12Z","git_url":"git://github.com/CenterForOpenScience/osf.io.git","ssh_url":"git@github.com:CenterForOpenScience/osf.io.git","clone_url":"https://github.com/CenterForOpenScience/osf.io.git","svn_url":"https://github.com/CenterForOpenScience/osf.io","homepage":"http://osf.io","size":279557,"stargazers_count":220,"watchers_count":220,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":181,"mirror_url":null,"open_issues_count":233,"forks":181,"open_issues":233,"watchers":220,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5715"},"html":{"href":"https://github.com/CenterForOpenScience/osf.io/pull/5715"},"issue":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/5715"},"comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/5715/comments"},"review_comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5715/comments"},"review_comment":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/5715/commits"},"statuses":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/ff2ba1727e43e637e6d9fb6876a75479f3bfdba3"}}}}
{"actor":{"display_login":"brianjgeiger"}}