{"action":"created","comment":{"url":"https://api.github.com/repos/aldryn/aldryn-reversion/pulls/comments/36991139","id":36991139,"diff_hunk":"@@ -60,27 +60,25 @@ def get_translations_versions_for_object(obj, revision, versions=None):\n     return translation_version\n \n \n-def get_required_fk_models(obj):\n+def get_fk_models(obj, blank=None):\n     \"\"\"\n     Returns required (blank=False) FK models for given object.\n     \"\"\"\n     fk_fields = [fk for fk in obj._meta.fields if type(fk) == ForeignKey]\n-    required_fks_models = [fk.rel.to for fk in fk_fields if not fk.blank]\n-    return required_fks_models\n+    fks_models = []\n+    for fk in fk_fields:\n+        if (blank is not None and fk.blank == blank) or blank is None:","path":"aldryn_reversion/utils.py","position":null,"original_position":14,"commit_id":"8de5c3bc270c4255e5a55c66e8f4b05865d03744","original_commit_id":"d7ebd00856ede5396923fb81b20343cc47ca789a","user":{"login":"cyberstar","id":744434,"avatar_url":"https://avatars.githubusercontent.com/u/744434?v=3","gravatar_id":"","url":"https://api.github.com/users/cyberstar","html_url":"https://github.com/cyberstar","followers_url":"https://api.github.com/users/cyberstar/followers","following_url":"https://api.github.com/users/cyberstar/following{/other_user}","gists_url":"https://api.github.com/users/cyberstar/gists{/gist_id}","starred_url":"https://api.github.com/users/cyberstar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyberstar/subscriptions","organizations_url":"https://api.github.com/users/cyberstar/orgs","repos_url":"https://api.github.com/users/cyberstar/repos","events_url":"https://api.github.com/users/cyberstar/events{/privacy}","received_events_url":"https://api.github.com/users/cyberstar/received_events","type":"User","site_admin":false},"body":"You're right! Thanks for comment!","created_at":"2015-08-13T15:56:31Z","updated_at":"2015-08-13T15:56:31Z","html_url":"https://github.com/aldryn/aldryn-reversion/pull/13#discussion_r36991139","pull_request_url":"https://api.github.com/repos/aldryn/aldryn-reversion/pulls/13","_links":{"self":{"href":"https://api.github.com/repos/aldryn/aldryn-reversion/pulls/comments/36991139"},"html":{"href":"https://github.com/aldryn/aldryn-reversion/pull/13#discussion_r36991139"},"pull_request":{"href":"https://api.github.com/repos/aldryn/aldryn-reversion/pulls/13"}}},"pull_request":{"url":"https://api.github.com/repos/aldryn/aldryn-reversion/pulls/13","id":42364660,"html_url":"https://github.com/aldryn/aldryn-reversion/pull/13","diff_url":"https://github.com/aldryn/aldryn-reversion/pull/13.diff","patch_url":"https://github.com/aldryn/aldryn-reversion/pull/13.patch","issue_url":"https://api.github.com/repos/aldryn/aldryn-reversion/issues/13","number":13,"state":"open","locked":false,"title":"Test cases: Base class for test cases, tests and fixes for utils.","user":{"login":"cyberstar","id":744434,"avatar_url":"https://avatars.githubusercontent.com/u/744434?v=3","gravatar_id":"","url":"https://api.github.com/users/cyberstar","html_url":"https://github.com/cyberstar","followers_url":"https://api.github.com/users/cyberstar/followers","following_url":"https://api.github.com/users/cyberstar/following{/other_user}","gists_url":"https://api.github.com/users/cyberstar/gists{/gist_id}","starred_url":"https://api.github.com/users/cyberstar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cyberstar/subscriptions","organizations_url":"https://api.github.com/users/cyberstar/orgs","repos_url":"https://api.github.com/users/cyberstar/repos","events_url":"https://api.github.com/users/cyberstar/events{/privacy}","received_events_url":"https://api.github.com/users/cyberstar/received_events","type":"User","site_admin":false},"body":"**Should be rebased** after merge of #11 and #12 since this PR depends on them\r\n* Base class for test cases (some utility methods),\r\n* Test cases to cover logic in utils.py (edge cases, normal cases),\r\n* Fixes for some issues in utils .\r\n\r\nThough test cases can be refactored to reduce boilerplate code.","created_at":"2015-08-13T15:35:33Z","updated_at":"2015-08-13T15:56:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"309493fa0d60ff982b5f36667749c6717a66aec0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/aldryn/aldryn-reversion/pulls/13/commits","review_comments_url":"https://api.github.com/repos/aldryn/aldryn-reversion/pulls/13/comments","review_comment_url":"https://api.github.com/repos/aldryn/aldryn-reversion/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aldryn/aldryn-reversion/issues/13/comments","statuses_url":"https://api.github.com/repos/aldryn/aldryn-reversion/statuses/8de5c3bc270c4255e5a55c66e8f4b05865d03744","head":{"label":"aldryn:feature/test-cases-and-fixes-for-utils","ref":"feature/test-cases-and-fixes-for-utils","sha":"8de5c3bc270c4255e5a55c66e8f4b05865d03744","user":{"login":"aldryn","id":4201738,"avatar_url":"https://avatars.githubusercontent.com/u/4201738?v=3","gravatar_id":"","url":"https://api.github.com/users/aldryn","html_url":"https://github.com/aldryn","followers_url":"https://api.github.com/users/aldryn/followers","following_url":"https://api.github.com/users/aldryn/following{/other_user}","gists_url":"https://api.github.com/users/aldryn/gists{/gist_id}","starred_url":"https://api.github.com/users/aldryn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldryn/subscriptions","organizations_url":"https://api.github.com/users/aldryn/orgs","repos_url":"https://api.github.com/users/aldryn/repos","events_url":"https://api.github.com/users/aldryn/events{/privacy}","received_events_url":"https://api.github.com/users/aldryn/received_events","type":"Organization","site_admin":false},"repo":{"id":31263598,"name":"aldryn-reversion","full_name":"aldryn/aldryn-reversion","owner":{"login":"aldryn","id":4201738,"avatar_url":"https://avatars.githubusercontent.com/u/4201738?v=3","gravatar_id":"","url":"https://api.github.com/users/aldryn","html_url":"https://github.com/aldryn","followers_url":"https://api.github.com/users/aldryn/followers","following_url":"https://api.github.com/users/aldryn/following{/other_user}","gists_url":"https://api.github.com/users/aldryn/gists{/gist_id}","starred_url":"https://api.github.com/users/aldryn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldryn/subscriptions","organizations_url":"https://api.github.com/users/aldryn/orgs","repos_url":"https://api.github.com/users/aldryn/repos","events_url":"https://api.github.com/users/aldryn/events{/privacy}","received_events_url":"https://api.github.com/users/aldryn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aldryn/aldryn-reversion","description":"","fork":false,"url":"https://api.github.com/repos/aldryn/aldryn-reversion","forks_url":"https://api.github.com/repos/aldryn/aldryn-reversion/forks","keys_url":"https://api.github.com/repos/aldryn/aldryn-reversion/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aldryn/aldryn-reversion/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aldryn/aldryn-reversion/teams","hooks_url":"https://api.github.com/repos/aldryn/aldryn-reversion/hooks","issue_events_url":"https://api.github.com/repos/aldryn/aldryn-reversion/issues/events{/number}","events_url":"https://api.github.com/repos/aldryn/aldryn-reversion/events","assignees_url":"https://api.github.com/repos/aldryn/aldryn-reversion/assignees{/user}","branches_url":"https://api.github.com/repos/aldryn/aldryn-reversion/branches{/branch}","tags_url":"https://api.github.com/repos/aldryn/aldryn-reversion/tags","blobs_url":"https://api.github.com/repos/aldryn/aldryn-reversion/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aldryn/aldryn-reversion/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aldryn/aldryn-reversion/git/refs{/sha}","trees_url":"https://api.github.com/repos/aldryn/aldryn-reversion/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aldryn/aldryn-reversion/statuses/{sha}","languages_url":"https://api.github.com/repos/aldryn/aldryn-reversion/languages","stargazers_url":"https://api.github.com/repos/aldryn/aldryn-reversion/stargazers","contributors_url":"https://api.github.com/repos/aldryn/aldryn-reversion/contributors","subscribers_url":"https://api.github.com/repos/aldryn/aldryn-reversion/subscribers","subscription_url":"https://api.github.com/repos/aldryn/aldryn-reversion/subscription","commits_url":"https://api.github.com/repos/aldryn/aldryn-reversion/commits{/sha}","git_commits_url":"https://api.github.com/repos/aldryn/aldryn-reversion/git/commits{/sha}","comments_url":"https://api.github.com/repos/aldryn/aldryn-reversion/comments{/number}","issue_comment_url":"https://api.github.com/repos/aldryn/aldryn-reversion/issues/comments{/number}","contents_url":"https://api.github.com/repos/aldryn/aldryn-reversion/contents/{+path}","compare_url":"https://api.github.com/repos/aldryn/aldryn-reversion/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aldryn/aldryn-reversion/merges","archive_url":"https://api.github.com/repos/aldryn/aldryn-reversion/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aldryn/aldryn-reversion/downloads","issues_url":"https://api.github.com/repos/aldryn/aldryn-reversion/issues{/number}","pulls_url":"https://api.github.com/repos/aldryn/aldryn-reversion/pulls{/number}","milestones_url":"https://api.github.com/repos/aldryn/aldryn-reversion/milestones{/number}","notifications_url":"https://api.github.com/repos/aldryn/aldryn-reversion/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aldryn/aldryn-reversion/labels{/name}","releases_url":"https://api.github.com/repos/aldryn/aldryn-reversion/releases{/id}","created_at":"2015-02-24T14:26:03Z","updated_at":"2015-03-25T18:18:46Z","pushed_at":"2015-08-13T15:55:49Z","git_url":"git://github.com/aldryn/aldryn-reversion.git","ssh_url":"git@github.com:aldryn/aldryn-reversion.git","clone_url":"https://github.com/aldryn/aldryn-reversion.git","svn_url":"https://github.com/aldryn/aldryn-reversion","homepage":null,"size":214,"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":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"aldryn:master","ref":"master","sha":"e18315dbcfe78a7de4b90eee205435b6757ec818","user":{"login":"aldryn","id":4201738,"avatar_url":"https://avatars.githubusercontent.com/u/4201738?v=3","gravatar_id":"","url":"https://api.github.com/users/aldryn","html_url":"https://github.com/aldryn","followers_url":"https://api.github.com/users/aldryn/followers","following_url":"https://api.github.com/users/aldryn/following{/other_user}","gists_url":"https://api.github.com/users/aldryn/gists{/gist_id}","starred_url":"https://api.github.com/users/aldryn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldryn/subscriptions","organizations_url":"https://api.github.com/users/aldryn/orgs","repos_url":"https://api.github.com/users/aldryn/repos","events_url":"https://api.github.com/users/aldryn/events{/privacy}","received_events_url":"https://api.github.com/users/aldryn/received_events","type":"Organization","site_admin":false},"repo":{"id":31263598,"name":"aldryn-reversion","full_name":"aldryn/aldryn-reversion","owner":{"login":"aldryn","id":4201738,"avatar_url":"https://avatars.githubusercontent.com/u/4201738?v=3","gravatar_id":"","url":"https://api.github.com/users/aldryn","html_url":"https://github.com/aldryn","followers_url":"https://api.github.com/users/aldryn/followers","following_url":"https://api.github.com/users/aldryn/following{/other_user}","gists_url":"https://api.github.com/users/aldryn/gists{/gist_id}","starred_url":"https://api.github.com/users/aldryn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aldryn/subscriptions","organizations_url":"https://api.github.com/users/aldryn/orgs","repos_url":"https://api.github.com/users/aldryn/repos","events_url":"https://api.github.com/users/aldryn/events{/privacy}","received_events_url":"https://api.github.com/users/aldryn/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aldryn/aldryn-reversion","description":"","fork":false,"url":"https://api.github.com/repos/aldryn/aldryn-reversion","forks_url":"https://api.github.com/repos/aldryn/aldryn-reversion/forks","keys_url":"https://api.github.com/repos/aldryn/aldryn-reversion/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aldryn/aldryn-reversion/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aldryn/aldryn-reversion/teams","hooks_url":"https://api.github.com/repos/aldryn/aldryn-reversion/hooks","issue_events_url":"https://api.github.com/repos/aldryn/aldryn-reversion/issues/events{/number}","events_url":"https://api.github.com/repos/aldryn/aldryn-reversion/events","assignees_url":"https://api.github.com/repos/aldryn/aldryn-reversion/assignees{/user}","branches_url":"https://api.github.com/repos/aldryn/aldryn-reversion/branches{/branch}","tags_url":"https://api.github.com/repos/aldryn/aldryn-reversion/tags","blobs_url":"https://api.github.com/repos/aldryn/aldryn-reversion/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aldryn/aldryn-reversion/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aldryn/aldryn-reversion/git/refs{/sha}","trees_url":"https://api.github.com/repos/aldryn/aldryn-reversion/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aldryn/aldryn-reversion/statuses/{sha}","languages_url":"https://api.github.com/repos/aldryn/aldryn-reversion/languages","stargazers_url":"https://api.github.com/repos/aldryn/aldryn-reversion/stargazers","contributors_url":"https://api.github.com/repos/aldryn/aldryn-reversion/contributors","subscribers_url":"https://api.github.com/repos/aldryn/aldryn-reversion/subscribers","subscription_url":"https://api.github.com/repos/aldryn/aldryn-reversion/subscription","commits_url":"https://api.github.com/repos/aldryn/aldryn-reversion/commits{/sha}","git_commits_url":"https://api.github.com/repos/aldryn/aldryn-reversion/git/commits{/sha}","comments_url":"https://api.github.com/repos/aldryn/aldryn-reversion/comments{/number}","issue_comment_url":"https://api.github.com/repos/aldryn/aldryn-reversion/issues/comments{/number}","contents_url":"https://api.github.com/repos/aldryn/aldryn-reversion/contents/{+path}","compare_url":"https://api.github.com/repos/aldryn/aldryn-reversion/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aldryn/aldryn-reversion/merges","archive_url":"https://api.github.com/repos/aldryn/aldryn-reversion/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aldryn/aldryn-reversion/downloads","issues_url":"https://api.github.com/repos/aldryn/aldryn-reversion/issues{/number}","pulls_url":"https://api.github.com/repos/aldryn/aldryn-reversion/pulls{/number}","milestones_url":"https://api.github.com/repos/aldryn/aldryn-reversion/milestones{/number}","notifications_url":"https://api.github.com/repos/aldryn/aldryn-reversion/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aldryn/aldryn-reversion/labels{/name}","releases_url":"https://api.github.com/repos/aldryn/aldryn-reversion/releases{/id}","created_at":"2015-02-24T14:26:03Z","updated_at":"2015-03-25T18:18:46Z","pushed_at":"2015-08-13T15:55:49Z","git_url":"git://github.com/aldryn/aldryn-reversion.git","ssh_url":"git@github.com:aldryn/aldryn-reversion.git","clone_url":"https://github.com/aldryn/aldryn-reversion.git","svn_url":"https://github.com/aldryn/aldryn-reversion","homepage":null,"size":214,"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":4,"forks":0,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aldryn/aldryn-reversion/pulls/13"},"html":{"href":"https://github.com/aldryn/aldryn-reversion/pull/13"},"issue":{"href":"https://api.github.com/repos/aldryn/aldryn-reversion/issues/13"},"comments":{"href":"https://api.github.com/repos/aldryn/aldryn-reversion/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/aldryn/aldryn-reversion/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/aldryn/aldryn-reversion/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aldryn/aldryn-reversion/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/aldryn/aldryn-reversion/statuses/8de5c3bc270c4255e5a55c66e8f4b05865d03744"}}}}