GitHub PullRequestReviewCommentEvent at 2014-04-09 21:06:40
Repository: pulp
Actor: rbarlow
Payload: {"comment":{"url":"https://api.github.com/repos/pulp/pulp/pulls/comments/11458715","id":11458715,"diff_hunk":"@@ -134,13 +134,17 @@ def regenerate_applicability_for_repos(repo_criteria):\n         for repo_id in repo_ids:\n             # Find all existing applicabilities for given repo_id\n             existing_applicabilities = RepoProfileApplicability.get_collection().find(\n-                {'repo_id':repo_id})\n+                {'repo_id': repo_id})\n             for existing_applicability in existing_applicabilities:\n                 # Convert cursor to RepoProfileApplicability object\n                 existing_applicability = RepoProfileApplicability(**dict(existing_applicability))\n                 profile_hash = existing_applicability['profile_hash']\n                 unit_profile = UnitProfile.get_collection().find_one({'profile_hash': profile_hash},\n                                                                      fields=['id', 'content_type'])\n+                # In case when a consumer unit profile is updated, but profile regeneration for that consumer\n+                # is not requested, unit_profile will be None.\n+                if unit_profile is None:\n+                    continue","path":"server/pulp/server/managers/consumer/applicability.py","position":15,"original_position":15,"commit_id":"e0a9c10648440d962a1df03d0d7ca7e7c7e21f16","original_commit_id":"e0a9c10648440d962a1df03d0d7ca7e7c7e21f16","user":{"login":"rbarlow","id":354506,"avatar_url":"https://avatars.githubusercontent.com/u/354506?","gravatar_id":"efe3d34a82c5f91a8dd09de511701ec6","url":"https://api.github.com/users/rbarlow","html_url":"https://github.com/rbarlow","followers_url":"https://api.github.com/users/rbarlow/followers","following_url":"https://api.github.com/users/rbarlow/following{/other_user}","gists_url":"https://api.github.com/users/rbarlow/gists{/gist_id}","starred_url":"https://api.github.com/users/rbarlow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbarlow/subscriptions","organizations_url":"https://api.github.com/users/rbarlow/orgs","repos_url":"https://api.github.com/users/rbarlow/repos","events_url":"https://api.github.com/users/rbarlow/events{/privacy}","received_events_url":"https://api.github.com/users/rbarlow/received_events","type":"User","site_admin":false},"body":"Also, the unit test you've written does not actually trigger this condition, and this line is not tested.","created_at":"2014-04-09T21:06:40Z","updated_at":"2014-04-09T21:06:40Z","html_url":"https://github.com/pulp/pulp/pull/890#discussion_r11458715","pull_request_url":"https://api.github.com/repos/pulp/pulp/pulls/890","_links":{"self":{"href":"https://api.github.com/repos/pulp/pulp/pulls/comments/11458715"},"html":{"href":"https://github.com/pulp/pulp/pull/890#discussion_r11458715"},"pull_request":{"href":"https://api.github.com/repos/pulp/pulp/pulls/890"}}}}