{"action":"created","comment":{"url":"https://api.github.com/repos/unicef/etools/pulls/comments/155873099","pull_request_review_id":82270609,"id":155873099,"diff_hunk":"@@ -197,8 +197,7 @@ def update_partners(country_name=None):\n         for partner in partners:\n             try:\n                 PartnerOrganization.micro_assessment_needed(partner)\n-                if partner.total_ct_cp > 500000:\n-                    PartnerOrganization.audit_needed(partner)\n+                PartnerOrganization.audit_needed(partner)","path":"EquiTrack/vision/tasks.py","position":6,"original_position":6,"commit_id":"0619e0ad18e59f98b029e3c3127f61158fdef0d2","original_commit_id":"b5a40326a855d02d36b2ca24f42af150d715e790","user":{"login":"ntrncic","id":11025927,"avatar_url":"https://avatars1.githubusercontent.com/u/11025927?v=4","gravatar_id":"","url":"https://api.github.com/users/ntrncic","html_url":"https://github.com/ntrncic","followers_url":"https://api.github.com/users/ntrncic/followers","following_url":"https://api.github.com/users/ntrncic/following{/other_user}","gists_url":"https://api.github.com/users/ntrncic/gists{/gist_id}","starred_url":"https://api.github.com/users/ntrncic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ntrncic/subscriptions","organizations_url":"https://api.github.com/users/ntrncic/orgs","repos_url":"https://api.github.com/users/ntrncic/repos","events_url":"https://api.github.com/users/ntrncic/events{/privacy}","received_events_url":"https://api.github.com/users/ntrncic/received_events","type":"User","site_admin":false},"body":"@caktus-philip we still want the partner to be saved on initial run to `1` or `0`. then when running the task, it would update if its a `1`. maybe an `if` `else` would work in `audit_needed`?","created_at":"2017-12-08T20:52:04Z","updated_at":"2017-12-08T20:52:04Z","html_url":"https://github.com/unicef/etools/pull/1045#discussion_r155873099","pull_request_url":"https://api.github.com/repos/unicef/etools/pulls/1045","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/unicef/etools/pulls/comments/155873099"},"html":{"href":"https://github.com/unicef/etools/pull/1045#discussion_r155873099"},"pull_request":{"href":"https://api.github.com/repos/unicef/etools/pulls/1045"}},"in_reply_to_id":152389513},"pull_request":{"url":"https://api.github.com/repos/unicef/etools/pulls/1045","id":152635100,"html_url":"https://github.com/unicef/etools/pull/1045","diff_url":"https://github.com/unicef/etools/pull/1045.diff","patch_url":"https://github.com/unicef/etools/pull/1045.patch","issue_url":"https://api.github.com/repos/unicef/etools/issues/1045","number":1045,"state":"open","locked":false,"title":"Replace PartnerOrganization hardcoded cash xfer level number with a constant","user":{"login":"caktus-philip","id":7290643,"avatar_url":"https://avatars2.githubusercontent.com/u/7290643?v=4","gravatar_id":"","url":"https://api.github.com/users/caktus-philip","html_url":"https://github.com/caktus-philip","followers_url":"https://api.github.com/users/caktus-philip/followers","following_url":"https://api.github.com/users/caktus-philip/following{/other_user}","gists_url":"https://api.github.com/users/caktus-philip/gists{/gist_id}","starred_url":"https://api.github.com/users/caktus-philip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caktus-philip/subscriptions","organizations_url":"https://api.github.com/users/caktus-philip/orgs","repos_url":"https://api.github.com/users/caktus-philip/repos","events_url":"https://api.github.com/users/caktus-philip/events{/privacy}","received_events_url":"https://api.github.com/users/caktus-philip/received_events","type":"User","site_admin":false},"body":"Replace hardcoded `500,000.00` with new constant `PartnerOrganization.CT_CP_AUDIT_TRIGGER_LEVEL`. This makes it easier to find, use, and change this value. \r\n\r\nIt also reduces the likelihood of comparing this `Decimal` value to a `float` which is risky in Python. The results of such comparisons depend on the behavior of the underlying C library, and may be unexpected. For instance --\r\n\r\n```\r\n$ python2\r\nPython 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 12:54:16)\r\n[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> from decimal import Decimal\r\n>>> Decimal('500000.00') == 500000.00   # This works as expected\r\nTrue\r\n>>> Decimal('1.1') == 1.1   # Surprise!\r\nFalse\r\n>>> Decimal('1.1') < 1.1    # Surprise!\r\nTrue\r\n```\r\n\r\nThere are other similarly problematic hardcoded values in `partners/models.py` but I will address them in another PR.\r\n\r\nOther fixes in this PR - \r\n - fixed many (but not all) cases where 'assessment' was spelled as 'assesment'\r\n - removed unused param from `PartnerOrganization.audit_needed()`\r\n\r\n","created_at":"2017-11-14T22:25:55Z","updated_at":"2017-12-08T20:52:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"489d60c3ae39afee4e52e67a6d6bb8ee070eee8c","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/unicef/etools/pulls/1045/commits","review_comments_url":"https://api.github.com/repos/unicef/etools/pulls/1045/comments","review_comment_url":"https://api.github.com/repos/unicef/etools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/unicef/etools/issues/1045/comments","statuses_url":"https://api.github.com/repos/unicef/etools/statuses/0619e0ad18e59f98b029e3c3127f61158fdef0d2","head":{"label":"unicef:replace-magic-numbers-with-constants","ref":"replace-magic-numbers-with-constants","sha":"0619e0ad18e59f98b029e3c3127f61158fdef0d2","user":{"login":"unicef","id":175849,"avatar_url":"https://avatars0.githubusercontent.com/u/175849?v=4","gravatar_id":"","url":"https://api.github.com/users/unicef","html_url":"https://github.com/unicef","followers_url":"https://api.github.com/users/unicef/followers","following_url":"https://api.github.com/users/unicef/following{/other_user}","gists_url":"https://api.github.com/users/unicef/gists{/gist_id}","starred_url":"https://api.github.com/users/unicef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unicef/subscriptions","organizations_url":"https://api.github.com/users/unicef/orgs","repos_url":"https://api.github.com/users/unicef/repos","events_url":"https://api.github.com/users/unicef/events{/privacy}","received_events_url":"https://api.github.com/users/unicef/received_events","type":"Organization","site_admin":false},"repo":{"id":54648215,"name":"etools","full_name":"unicef/etools","owner":{"login":"unicef","id":175849,"avatar_url":"https://avatars0.githubusercontent.com/u/175849?v=4","gravatar_id":"","url":"https://api.github.com/users/unicef","html_url":"https://github.com/unicef","followers_url":"https://api.github.com/users/unicef/followers","following_url":"https://api.github.com/users/unicef/following{/other_user}","gists_url":"https://api.github.com/users/unicef/gists{/gist_id}","starred_url":"https://api.github.com/users/unicef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unicef/subscriptions","organizations_url":"https://api.github.com/users/unicef/orgs","repos_url":"https://api.github.com/users/unicef/repos","events_url":"https://api.github.com/users/unicef/events{/privacy}","received_events_url":"https://api.github.com/users/unicef/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/unicef/etools","description":null,"fork":false,"url":"https://api.github.com/repos/unicef/etools","forks_url":"https://api.github.com/repos/unicef/etools/forks","keys_url":"https://api.github.com/repos/unicef/etools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/unicef/etools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/unicef/etools/teams","hooks_url":"https://api.github.com/repos/unicef/etools/hooks","issue_events_url":"https://api.github.com/repos/unicef/etools/issues/events{/number}","events_url":"https://api.github.com/repos/unicef/etools/events","assignees_url":"https://api.github.com/repos/unicef/etools/assignees{/user}","branches_url":"https://api.github.com/repos/unicef/etools/branches{/branch}","tags_url":"https://api.github.com/repos/unicef/etools/tags","blobs_url":"https://api.github.com/repos/unicef/etools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/unicef/etools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/unicef/etools/git/refs{/sha}","trees_url":"https://api.github.com/repos/unicef/etools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/unicef/etools/statuses/{sha}","languages_url":"https://api.github.com/repos/unicef/etools/languages","stargazers_url":"https://api.github.com/repos/unicef/etools/stargazers","contributors_url":"https://api.github.com/repos/unicef/etools/contributors","subscribers_url":"https://api.github.com/repos/unicef/etools/subscribers","subscription_url":"https://api.github.com/repos/unicef/etools/subscription","commits_url":"https://api.github.com/repos/unicef/etools/commits{/sha}","git_commits_url":"https://api.github.com/repos/unicef/etools/git/commits{/sha}","comments_url":"https://api.github.com/repos/unicef/etools/comments{/number}","issue_comment_url":"https://api.github.com/repos/unicef/etools/issues/comments{/number}","contents_url":"https://api.github.com/repos/unicef/etools/contents/{+path}","compare_url":"https://api.github.com/repos/unicef/etools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/unicef/etools/merges","archive_url":"https://api.github.com/repos/unicef/etools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/unicef/etools/downloads","issues_url":"https://api.github.com/repos/unicef/etools/issues{/number}","pulls_url":"https://api.github.com/repos/unicef/etools/pulls{/number}","milestones_url":"https://api.github.com/repos/unicef/etools/milestones{/number}","notifications_url":"https://api.github.com/repos/unicef/etools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/unicef/etools/labels{/name}","releases_url":"https://api.github.com/repos/unicef/etools/releases{/id}","deployments_url":"https://api.github.com/repos/unicef/etools/deployments","created_at":"2016-03-24T14:28:49Z","updated_at":"2017-11-16T14:31:40Z","pushed_at":"2017-12-08T20:41:00Z","git_url":"git://github.com/unicef/etools.git","ssh_url":"git@github.com:unicef/etools.git","clone_url":"https://github.com/unicef/etools.git","svn_url":"https://github.com/unicef/etools","homepage":null,"size":90867,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":92,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0"},"forks":7,"open_issues":92,"watchers":8,"default_branch":"master"}},"base":{"label":"unicef:develop","ref":"develop","sha":"5c10756576cf676298ffa512aad5216d1b506a11","user":{"login":"unicef","id":175849,"avatar_url":"https://avatars0.githubusercontent.com/u/175849?v=4","gravatar_id":"","url":"https://api.github.com/users/unicef","html_url":"https://github.com/unicef","followers_url":"https://api.github.com/users/unicef/followers","following_url":"https://api.github.com/users/unicef/following{/other_user}","gists_url":"https://api.github.com/users/unicef/gists{/gist_id}","starred_url":"https://api.github.com/users/unicef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unicef/subscriptions","organizations_url":"https://api.github.com/users/unicef/orgs","repos_url":"https://api.github.com/users/unicef/repos","events_url":"https://api.github.com/users/unicef/events{/privacy}","received_events_url":"https://api.github.com/users/unicef/received_events","type":"Organization","site_admin":false},"repo":{"id":54648215,"name":"etools","full_name":"unicef/etools","owner":{"login":"unicef","id":175849,"avatar_url":"https://avatars0.githubusercontent.com/u/175849?v=4","gravatar_id":"","url":"https://api.github.com/users/unicef","html_url":"https://github.com/unicef","followers_url":"https://api.github.com/users/unicef/followers","following_url":"https://api.github.com/users/unicef/following{/other_user}","gists_url":"https://api.github.com/users/unicef/gists{/gist_id}","starred_url":"https://api.github.com/users/unicef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unicef/subscriptions","organizations_url":"https://api.github.com/users/unicef/orgs","repos_url":"https://api.github.com/users/unicef/repos","events_url":"https://api.github.com/users/unicef/events{/privacy}","received_events_url":"https://api.github.com/users/unicef/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/unicef/etools","description":null,"fork":false,"url":"https://api.github.com/repos/unicef/etools","forks_url":"https://api.github.com/repos/unicef/etools/forks","keys_url":"https://api.github.com/repos/unicef/etools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/unicef/etools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/unicef/etools/teams","hooks_url":"https://api.github.com/repos/unicef/etools/hooks","issue_events_url":"https://api.github.com/repos/unicef/etools/issues/events{/number}","events_url":"https://api.github.com/repos/unicef/etools/events","assignees_url":"https://api.github.com/repos/unicef/etools/assignees{/user}","branches_url":"https://api.github.com/repos/unicef/etools/branches{/branch}","tags_url":"https://api.github.com/repos/unicef/etools/tags","blobs_url":"https://api.github.com/repos/unicef/etools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/unicef/etools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/unicef/etools/git/refs{/sha}","trees_url":"https://api.github.com/repos/unicef/etools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/unicef/etools/statuses/{sha}","languages_url":"https://api.github.com/repos/unicef/etools/languages","stargazers_url":"https://api.github.com/repos/unicef/etools/stargazers","contributors_url":"https://api.github.com/repos/unicef/etools/contributors","subscribers_url":"https://api.github.com/repos/unicef/etools/subscribers","subscription_url":"https://api.github.com/repos/unicef/etools/subscription","commits_url":"https://api.github.com/repos/unicef/etools/commits{/sha}","git_commits_url":"https://api.github.com/repos/unicef/etools/git/commits{/sha}","comments_url":"https://api.github.com/repos/unicef/etools/comments{/number}","issue_comment_url":"https://api.github.com/repos/unicef/etools/issues/comments{/number}","contents_url":"https://api.github.com/repos/unicef/etools/contents/{+path}","compare_url":"https://api.github.com/repos/unicef/etools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/unicef/etools/merges","archive_url":"https://api.github.com/repos/unicef/etools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/unicef/etools/downloads","issues_url":"https://api.github.com/repos/unicef/etools/issues{/number}","pulls_url":"https://api.github.com/repos/unicef/etools/pulls{/number}","milestones_url":"https://api.github.com/repos/unicef/etools/milestones{/number}","notifications_url":"https://api.github.com/repos/unicef/etools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/unicef/etools/labels{/name}","releases_url":"https://api.github.com/repos/unicef/etools/releases{/id}","deployments_url":"https://api.github.com/repos/unicef/etools/deployments","created_at":"2016-03-24T14:28:49Z","updated_at":"2017-11-16T14:31:40Z","pushed_at":"2017-12-08T20:41:00Z","git_url":"git://github.com/unicef/etools.git","ssh_url":"git@github.com:unicef/etools.git","clone_url":"https://github.com/unicef/etools.git","svn_url":"https://github.com/unicef/etools","homepage":null,"size":90867,"stargazers_count":8,"watchers_count":8,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":92,"license":{"key":"agpl-3.0","name":"GNU Affero General Public License v3.0","spdx_id":"AGPL-3.0","url":"https://api.github.com/licenses/agpl-3.0"},"forks":7,"open_issues":92,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/unicef/etools/pulls/1045"},"html":{"href":"https://github.com/unicef/etools/pull/1045"},"issue":{"href":"https://api.github.com/repos/unicef/etools/issues/1045"},"comments":{"href":"https://api.github.com/repos/unicef/etools/issues/1045/comments"},"review_comments":{"href":"https://api.github.com/repos/unicef/etools/pulls/1045/comments"},"review_comment":{"href":"https://api.github.com/repos/unicef/etools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/unicef/etools/pulls/1045/commits"},"statuses":{"href":"https://api.github.com/repos/unicef/etools/statuses/0619e0ad18e59f98b029e3c3127f61158fdef0d2"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"ntrncic"}}