{"action":"created","comment":{"url":"https://api.github.com/repos/google/ggrc-core/pulls/comments/75304687","id":75304687,"diff_hunk":"@@ -320,9 +320,24 @@ def _check_mandatory_comment(self):\n \n   def _check_mandatory_evidence(self):\n     \"\"\"Check presence of mandatory evidence.\"\"\"\n-    # pylint: disable=no-self-use\n-    # not implemented yet\n-    return []\n+    if hasattr(self.attributable, \"object_documents\"):\n+      # Note: this is a suboptimal implementation of mandatory evidence check;\n+      # it should be refactored once Evicence-CA mapping is introduced\n+      def evidence_required(cav):\n+        flags = (self._multi_choice_options_to_flags(cav.custom_attribute)\n+                 .get(cav.attribute_value))\n+        return flags and flags.evidence_required\n+      evidence_found = (len(self.attributable.object_documents) >=\n+                        len([cav\n+                             for cav in self.attributable","path":"src/ggrc/models/custom_attribute_value.py","position":17,"original_position":16,"commit_id":"1d362340d92c16a8799025f6e0402d88690932a7","original_commit_id":"8c0d709b47ac3eb84c37b8f388f439124f74bbde","user":{"login":"zidarsk8","id":566311,"avatar_url":"https://avatars.githubusercontent.com/u/566311?v=3","gravatar_id":"","url":"https://api.github.com/users/zidarsk8","html_url":"https://github.com/zidarsk8","followers_url":"https://api.github.com/users/zidarsk8/followers","following_url":"https://api.github.com/users/zidarsk8/following{/other_user}","gists_url":"https://api.github.com/users/zidarsk8/gists{/gist_id}","starred_url":"https://api.github.com/users/zidarsk8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zidarsk8/subscriptions","organizations_url":"https://api.github.com/users/zidarsk8/orgs","repos_url":"https://api.github.com/users/zidarsk8/repos","events_url":"https://api.github.com/users/zidarsk8/events{/privacy}","received_events_url":"https://api.github.com/users/zidarsk8/received_events","type":"User","site_admin":false},"body":"@alieh-rymasheuski As I see it, this code will be changed when we start tracking which evidence is for which CAV, same as we do with comments. So for now this is fine.\r\n\r\nI am willing to merge this PR, as soon as I find the ticket for this refactor in the future.","created_at":"2016-08-18T13:13:12Z","updated_at":"2016-08-18T13:13:12Z","html_url":"https://github.com/google/ggrc-core/pull/4283#discussion_r75304687","pull_request_url":"https://api.github.com/repos/google/ggrc-core/pulls/4283","_links":{"self":{"href":"https://api.github.com/repos/google/ggrc-core/pulls/comments/75304687"},"html":{"href":"https://github.com/google/ggrc-core/pull/4283#discussion_r75304687"},"pull_request":{"href":"https://api.github.com/repos/google/ggrc-core/pulls/4283"}}},"pull_request":{"url":"https://api.github.com/repos/google/ggrc-core/pulls/4283","id":81325860,"html_url":"https://github.com/google/ggrc-core/pull/4283","diff_url":"https://github.com/google/ggrc-core/pull/4283.diff","patch_url":"https://github.com/google/ggrc-core/pull/4283.patch","issue_url":"https://api.github.com/repos/google/ggrc-core/issues/4283","number":4283,"state":"open","locked":false,"title":"FEATURE Mandatory evidence check","user":{"login":"alieh-rymasheuski","id":9883236,"avatar_url":"https://avatars.githubusercontent.com/u/9883236?v=3","gravatar_id":"","url":"https://api.github.com/users/alieh-rymasheuski","html_url":"https://github.com/alieh-rymasheuski","followers_url":"https://api.github.com/users/alieh-rymasheuski/followers","following_url":"https://api.github.com/users/alieh-rymasheuski/following{/other_user}","gists_url":"https://api.github.com/users/alieh-rymasheuski/gists{/gist_id}","starred_url":"https://api.github.com/users/alieh-rymasheuski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alieh-rymasheuski/subscriptions","organizations_url":"https://api.github.com/users/alieh-rymasheuski/orgs","repos_url":"https://api.github.com/users/alieh-rymasheuski/repos","events_url":"https://api.github.com/users/alieh-rymasheuski/events{/privacy}","received_events_url":"https://api.github.com/users/alieh-rymasheuski/received_events","type":"User","site_admin":false},"body":"~~This PR depends on #4275 and can't be merged before it.~~\r\n\r\nThis PR enables mandatory evidence check on the backend and makes preconditions check on the frontend unneeded.\r\n\r\nThe logic of mandatory evidence check is the same as it used to be on the frontend: mandatory evidence preconditions fails for every CAV requiring evidence if the number of evidences required is greater than the number of evidences provided. This is a temporary solution until we make a decision on how Evidence - CA mapping should behave, what can be mapped to what and how will evidence reuse work in this case.","created_at":"2016-08-15T15:13:24Z","updated_at":"2016-08-18T13:13:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"92aecc777e2d15cf1f0b2981742c1d4ee35582af","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/google/ggrc-core/milestones/21","html_url":"https://github.com/google/ggrc-core/milestones/0.9.7-Quince","labels_url":"https://api.github.com/repos/google/ggrc-core/milestones/21/labels","id":1845906,"number":21,"title":"0.9.7-Quince","description":"","creator":{"login":"Smotko","id":513444,"avatar_url":"https://avatars.githubusercontent.com/u/513444?v=3","gravatar_id":"","url":"https://api.github.com/users/Smotko","html_url":"https://github.com/Smotko","followers_url":"https://api.github.com/users/Smotko/followers","following_url":"https://api.github.com/users/Smotko/following{/other_user}","gists_url":"https://api.github.com/users/Smotko/gists{/gist_id}","starred_url":"https://api.github.com/users/Smotko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Smotko/subscriptions","organizations_url":"https://api.github.com/users/Smotko/orgs","repos_url":"https://api.github.com/users/Smotko/repos","events_url":"https://api.github.com/users/Smotko/events{/privacy}","received_events_url":"https://api.github.com/users/Smotko/received_events","type":"User","site_admin":false},"open_issues":11,"closed_issues":221,"state":"open","created_at":"2016-06-23T17:56:25Z","updated_at":"2016-08-18T13:08:55Z","due_on":"2016-08-14T22:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/google/ggrc-core/pulls/4283/commits","review_comments_url":"https://api.github.com/repos/google/ggrc-core/pulls/4283/comments","review_comment_url":"https://api.github.com/repos/google/ggrc-core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/ggrc-core/issues/4283/comments","statuses_url":"https://api.github.com/repos/google/ggrc-core/statuses/1d362340d92c16a8799025f6e0402d88690932a7","head":{"label":"alieh-rymasheuski:FEATURE-mandatory-evidence-check","ref":"FEATURE-mandatory-evidence-check","sha":"1d362340d92c16a8799025f6e0402d88690932a7","user":{"login":"alieh-rymasheuski","id":9883236,"avatar_url":"https://avatars.githubusercontent.com/u/9883236?v=3","gravatar_id":"","url":"https://api.github.com/users/alieh-rymasheuski","html_url":"https://github.com/alieh-rymasheuski","followers_url":"https://api.github.com/users/alieh-rymasheuski/followers","following_url":"https://api.github.com/users/alieh-rymasheuski/following{/other_user}","gists_url":"https://api.github.com/users/alieh-rymasheuski/gists{/gist_id}","starred_url":"https://api.github.com/users/alieh-rymasheuski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alieh-rymasheuski/subscriptions","organizations_url":"https://api.github.com/users/alieh-rymasheuski/orgs","repos_url":"https://api.github.com/users/alieh-rymasheuski/repos","events_url":"https://api.github.com/users/alieh-rymasheuski/events{/privacy}","received_events_url":"https://api.github.com/users/alieh-rymasheuski/received_events","type":"User","site_admin":false},"repo":{"id":59271499,"name":"ggrc-core","full_name":"alieh-rymasheuski/ggrc-core","owner":{"login":"alieh-rymasheuski","id":9883236,"avatar_url":"https://avatars.githubusercontent.com/u/9883236?v=3","gravatar_id":"","url":"https://api.github.com/users/alieh-rymasheuski","html_url":"https://github.com/alieh-rymasheuski","followers_url":"https://api.github.com/users/alieh-rymasheuski/followers","following_url":"https://api.github.com/users/alieh-rymasheuski/following{/other_user}","gists_url":"https://api.github.com/users/alieh-rymasheuski/gists{/gist_id}","starred_url":"https://api.github.com/users/alieh-rymasheuski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alieh-rymasheuski/subscriptions","organizations_url":"https://api.github.com/users/alieh-rymasheuski/orgs","repos_url":"https://api.github.com/users/alieh-rymasheuski/repos","events_url":"https://api.github.com/users/alieh-rymasheuski/events{/privacy}","received_events_url":"https://api.github.com/users/alieh-rymasheuski/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/alieh-rymasheuski/ggrc-core","description":"GGRC Core","fork":true,"url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core","forks_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/forks","keys_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/teams","hooks_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/hooks","issue_events_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/issues/events{/number}","events_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/events","assignees_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/assignees{/user}","branches_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/branches{/branch}","tags_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/tags","blobs_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/statuses/{sha}","languages_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/languages","stargazers_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/stargazers","contributors_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/contributors","subscribers_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/subscribers","subscription_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/subscription","commits_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/contents/{+path}","compare_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/merges","archive_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/downloads","issues_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/issues{/number}","pulls_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/pulls{/number}","milestones_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/milestones{/number}","notifications_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/labels{/name}","releases_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/releases{/id}","deployments_url":"https://api.github.com/repos/alieh-rymasheuski/ggrc-core/deployments","created_at":"2016-05-20T06:44:56Z","updated_at":"2016-05-23T08:41:47Z","pushed_at":"2016-08-18T12:45:40Z","git_url":"git://github.com/alieh-rymasheuski/ggrc-core.git","ssh_url":"git@github.com:alieh-rymasheuski/ggrc-core.git","clone_url":"https://github.com/alieh-rymasheuski/ggrc-core.git","svn_url":"https://github.com/alieh-rymasheuski/ggrc-core","homepage":null,"size":54004,"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":"google:develop","ref":"develop","sha":"f129d6d3c63e61f87d037036f7c9e9e11e41ad65","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":9304637,"name":"ggrc-core","full_name":"google/ggrc-core","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/ggrc-core","description":"GGRC Core","fork":false,"url":"https://api.github.com/repos/google/ggrc-core","forks_url":"https://api.github.com/repos/google/ggrc-core/forks","keys_url":"https://api.github.com/repos/google/ggrc-core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/ggrc-core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/ggrc-core/teams","hooks_url":"https://api.github.com/repos/google/ggrc-core/hooks","issue_events_url":"https://api.github.com/repos/google/ggrc-core/issues/events{/number}","events_url":"https://api.github.com/repos/google/ggrc-core/events","assignees_url":"https://api.github.com/repos/google/ggrc-core/assignees{/user}","branches_url":"https://api.github.com/repos/google/ggrc-core/branches{/branch}","tags_url":"https://api.github.com/repos/google/ggrc-core/tags","blobs_url":"https://api.github.com/repos/google/ggrc-core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/ggrc-core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/ggrc-core/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/ggrc-core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/ggrc-core/statuses/{sha}","languages_url":"https://api.github.com/repos/google/ggrc-core/languages","stargazers_url":"https://api.github.com/repos/google/ggrc-core/stargazers","contributors_url":"https://api.github.com/repos/google/ggrc-core/contributors","subscribers_url":"https://api.github.com/repos/google/ggrc-core/subscribers","subscription_url":"https://api.github.com/repos/google/ggrc-core/subscription","commits_url":"https://api.github.com/repos/google/ggrc-core/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/ggrc-core/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/ggrc-core/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/ggrc-core/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/ggrc-core/contents/{+path}","compare_url":"https://api.github.com/repos/google/ggrc-core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/ggrc-core/merges","archive_url":"https://api.github.com/repos/google/ggrc-core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/ggrc-core/downloads","issues_url":"https://api.github.com/repos/google/ggrc-core/issues{/number}","pulls_url":"https://api.github.com/repos/google/ggrc-core/pulls{/number}","milestones_url":"https://api.github.com/repos/google/ggrc-core/milestones{/number}","notifications_url":"https://api.github.com/repos/google/ggrc-core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/ggrc-core/labels{/name}","releases_url":"https://api.github.com/repos/google/ggrc-core/releases{/id}","deployments_url":"https://api.github.com/repos/google/ggrc-core/deployments","created_at":"2013-04-08T19:16:28Z","updated_at":"2016-08-16T11:59:46Z","pushed_at":"2016-08-18T13:08:55Z","git_url":"git://github.com/google/ggrc-core.git","ssh_url":"git@github.com:google/ggrc-core.git","clone_url":"https://github.com/google/ggrc-core.git","svn_url":"https://github.com/google/ggrc-core","homepage":null,"size":64587,"stargazers_count":121,"watchers_count":121,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":93,"mirror_url":null,"open_issues_count":14,"forks":93,"open_issues":14,"watchers":121,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/google/ggrc-core/pulls/4283"},"html":{"href":"https://github.com/google/ggrc-core/pull/4283"},"issue":{"href":"https://api.github.com/repos/google/ggrc-core/issues/4283"},"comments":{"href":"https://api.github.com/repos/google/ggrc-core/issues/4283/comments"},"review_comments":{"href":"https://api.github.com/repos/google/ggrc-core/pulls/4283/comments"},"review_comment":{"href":"https://api.github.com/repos/google/ggrc-core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/ggrc-core/pulls/4283/commits"},"statuses":{"href":"https://api.github.com/repos/google/ggrc-core/statuses/1d362340d92c16a8799025f6e0402d88690932a7"}}}}
{"actor":{"display_login":"zidarsk8"}}