{"action":"created","comment":{"url":"https://api.github.com/repos/betagouv/pix/pulls/comments/165967310","pull_request_review_id":93983558,"id":165967310,"diff_hunk":"@@ -65,16 +65,18 @@ class Profile {\n     assessments.forEach(assessment => {\n       const courseIdFromAssessment = assessment.courseId;\n       const course = this._getCourseById(courses, courseIdFromAssessment);\n-      const competence = this.competences.find(competence => course.competences.includes(competence.id));\n-      competence.assessmentId = assessment.id;\n+      if(course) {\n+        const competence = this.competences.find(competence => course.competences.includes(competence.id));\n+        competence.assessmentId = assessment.id;\n+      }\n     });\n   }\n \n   _findAssessmentsByCompetenceId(assessments, courses, competenceId) {\n     return assessments.filter((assessment) => {\n       const courseIdFromAssessment = assessment.courseId;\n       const course = this._getCourseById(courses, courseIdFromAssessment);\n-      return course.competences.indexOf(competenceId) > -1;\n+      return course ? course.competences.indexOf(competenceId) > -1 : false;","path":"api/lib/domain/models/data/profile.js","position":null,"original_position":18,"commit_id":"f46d56d1ba6b52bd9fa1540092e92b9f12055b31","original_commit_id":"04b83b41ea247b1f1b35244ac9cce33ab4049e2e","user":{"login":"mlaurent","id":34855127,"avatar_url":"https://avatars2.githubusercontent.com/u/34855127?v=4","gravatar_id":"","url":"https://api.github.com/users/mlaurent","html_url":"https://github.com/mlaurent","followers_url":"https://api.github.com/users/mlaurent/followers","following_url":"https://api.github.com/users/mlaurent/following{/other_user}","gists_url":"https://api.github.com/users/mlaurent/gists{/gist_id}","starred_url":"https://api.github.com/users/mlaurent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mlaurent/subscriptions","organizations_url":"https://api.github.com/users/mlaurent/orgs","repos_url":"https://api.github.com/users/mlaurent/repos","events_url":"https://api.github.com/users/mlaurent/events{/privacy}","received_events_url":"https://api.github.com/users/mlaurent/received_events","type":"User","site_admin":false},"body":"Du coup, est-ce qu'on ne pourrait pas mettre \"return course && course.includes(competenceId)\" ?","created_at":"2018-02-05T13:12:17Z","updated_at":"2018-02-05T13:12:17Z","html_url":"https://github.com/betagouv/pix/pull/672#discussion_r165967310","pull_request_url":"https://api.github.com/repos/betagouv/pix/pulls/672","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/betagouv/pix/pulls/comments/165967310"},"html":{"href":"https://github.com/betagouv/pix/pull/672#discussion_r165967310"},"pull_request":{"href":"https://api.github.com/repos/betagouv/pix/pulls/672"}},"in_reply_to_id":165430228},"pull_request":{"url":"https://api.github.com/repos/betagouv/pix/pulls/672","id":166525669,"html_url":"https://github.com/betagouv/pix/pull/672","diff_url":"https://github.com/betagouv/pix/pull/672.diff","patch_url":"https://github.com/betagouv/pix/pull/672.patch","issue_url":"https://api.github.com/repos/betagouv/pix/issues/672","number":672,"state":"open","locked":false,"title":"[#672] [BUGFIX] Vérification que l'on trouve bien un Test d'après le courseId dans le profil (US-1047).","user":{"login":"MelanieMEB","id":31532858,"avatar_url":"https://avatars1.githubusercontent.com/u/31532858?v=4","gravatar_id":"","url":"https://api.github.com/users/MelanieMEB","html_url":"https://github.com/MelanieMEB","followers_url":"https://api.github.com/users/MelanieMEB/followers","following_url":"https://api.github.com/users/MelanieMEB/following{/other_user}","gists_url":"https://api.github.com/users/MelanieMEB/gists{/gist_id}","starred_url":"https://api.github.com/users/MelanieMEB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MelanieMEB/subscriptions","organizations_url":"https://api.github.com/users/MelanieMEB/orgs","repos_url":"https://api.github.com/users/MelanieMEB/repos","events_url":"https://api.github.com/users/MelanieMEB/events{/privacy}","received_events_url":"https://api.github.com/users/MelanieMEB/received_events","type":"User","site_admin":false},"body":"Le bug de connexion de benoit venait d'un test de DEMO passé par lui et enregistré dans ses assessments.\r\n\r\nAu moment de récupérer le profile (users/me) à la connexion, on tentait d'ajouter la compétence lié, sauf que le courseId ne correspond à aucune compétence. \r\n\r\nCorrection: lors de la création du profile, si on a besoin du course (de la compétence), on filtre ou on n'ajoute pas de compétence à l'assessment.","created_at":"2018-02-01T12:37:31Z","updated_at":"2018-02-05T13:12:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c318d6054f64bc4a94b149f27ede34626a198c68","assignee":{"login":"MelanieMEB","id":31532858,"avatar_url":"https://avatars1.githubusercontent.com/u/31532858?v=4","gravatar_id":"","url":"https://api.github.com/users/MelanieMEB","html_url":"https://github.com/MelanieMEB","followers_url":"https://api.github.com/users/MelanieMEB/followers","following_url":"https://api.github.com/users/MelanieMEB/following{/other_user}","gists_url":"https://api.github.com/users/MelanieMEB/gists{/gist_id}","starred_url":"https://api.github.com/users/MelanieMEB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MelanieMEB/subscriptions","organizations_url":"https://api.github.com/users/MelanieMEB/orgs","repos_url":"https://api.github.com/users/MelanieMEB/repos","events_url":"https://api.github.com/users/MelanieMEB/events{/privacy}","received_events_url":"https://api.github.com/users/MelanieMEB/received_events","type":"User","site_admin":false},"assignees":[{"login":"MelanieMEB","id":31532858,"avatar_url":"https://avatars1.githubusercontent.com/u/31532858?v=4","gravatar_id":"","url":"https://api.github.com/users/MelanieMEB","html_url":"https://github.com/MelanieMEB","followers_url":"https://api.github.com/users/MelanieMEB/followers","following_url":"https://api.github.com/users/MelanieMEB/following{/other_user}","gists_url":"https://api.github.com/users/MelanieMEB/gists{/gist_id}","starred_url":"https://api.github.com/users/MelanieMEB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MelanieMEB/subscriptions","organizations_url":"https://api.github.com/users/MelanieMEB/orgs","repos_url":"https://api.github.com/users/MelanieMEB/repos","events_url":"https://api.github.com/users/MelanieMEB/events{/privacy}","received_events_url":"https://api.github.com/users/MelanieMEB/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"milestone":null,"commits_url":"https://api.github.com/repos/betagouv/pix/pulls/672/commits","review_comments_url":"https://api.github.com/repos/betagouv/pix/pulls/672/comments","review_comment_url":"https://api.github.com/repos/betagouv/pix/pulls/comments{/number}","comments_url":"https://api.github.com/repos/betagouv/pix/issues/672/comments","statuses_url":"https://api.github.com/repos/betagouv/pix/statuses/f46d56d1ba6b52bd9fa1540092e92b9f12055b31","head":{"label":"betagouv:1047-bugfix-profile-with-demo-assessments","ref":"1047-bugfix-profile-with-demo-assessments","sha":"f46d56d1ba6b52bd9fa1540092e92b9f12055b31","user":{"login":"betagouv","id":7874148,"avatar_url":"https://avatars0.githubusercontent.com/u/7874148?v=4","gravatar_id":"","url":"https://api.github.com/users/betagouv","html_url":"https://github.com/betagouv","followers_url":"https://api.github.com/users/betagouv/followers","following_url":"https://api.github.com/users/betagouv/following{/other_user}","gists_url":"https://api.github.com/users/betagouv/gists{/gist_id}","starred_url":"https://api.github.com/users/betagouv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/betagouv/subscriptions","organizations_url":"https://api.github.com/users/betagouv/orgs","repos_url":"https://api.github.com/users/betagouv/repos","events_url":"https://api.github.com/users/betagouv/events{/privacy}","received_events_url":"https://api.github.com/users/betagouv/received_events","type":"Organization","site_admin":false},"repo":{"id":63066169,"name":"pix","full_name":"betagouv/pix","owner":{"login":"betagouv","id":7874148,"avatar_url":"https://avatars0.githubusercontent.com/u/7874148?v=4","gravatar_id":"","url":"https://api.github.com/users/betagouv","html_url":"https://github.com/betagouv","followers_url":"https://api.github.com/users/betagouv/followers","following_url":"https://api.github.com/users/betagouv/following{/other_user}","gists_url":"https://api.github.com/users/betagouv/gists{/gist_id}","starred_url":"https://api.github.com/users/betagouv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/betagouv/subscriptions","organizations_url":"https://api.github.com/users/betagouv/orgs","repos_url":"https://api.github.com/users/betagouv/repos","events_url":"https://api.github.com/users/betagouv/events{/privacy}","received_events_url":"https://api.github.com/users/betagouv/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/betagouv/pix","description":"Plateforme d'évaluation et de certification des compétences numériques à l'usage de tous les citoyens francophones.","fork":false,"url":"https://api.github.com/repos/betagouv/pix","forks_url":"https://api.github.com/repos/betagouv/pix/forks","keys_url":"https://api.github.com/repos/betagouv/pix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/betagouv/pix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/betagouv/pix/teams","hooks_url":"https://api.github.com/repos/betagouv/pix/hooks","issue_events_url":"https://api.github.com/repos/betagouv/pix/issues/events{/number}","events_url":"https://api.github.com/repos/betagouv/pix/events","assignees_url":"https://api.github.com/repos/betagouv/pix/assignees{/user}","branches_url":"https://api.github.com/repos/betagouv/pix/branches{/branch}","tags_url":"https://api.github.com/repos/betagouv/pix/tags","blobs_url":"https://api.github.com/repos/betagouv/pix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/betagouv/pix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/betagouv/pix/git/refs{/sha}","trees_url":"https://api.github.com/repos/betagouv/pix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/betagouv/pix/statuses/{sha}","languages_url":"https://api.github.com/repos/betagouv/pix/languages","stargazers_url":"https://api.github.com/repos/betagouv/pix/stargazers","contributors_url":"https://api.github.com/repos/betagouv/pix/contributors","subscribers_url":"https://api.github.com/repos/betagouv/pix/subscribers","subscription_url":"https://api.github.com/repos/betagouv/pix/subscription","commits_url":"https://api.github.com/repos/betagouv/pix/commits{/sha}","git_commits_url":"https://api.github.com/repos/betagouv/pix/git/commits{/sha}","comments_url":"https://api.github.com/repos/betagouv/pix/comments{/number}","issue_comment_url":"https://api.github.com/repos/betagouv/pix/issues/comments{/number}","contents_url":"https://api.github.com/repos/betagouv/pix/contents/{+path}","compare_url":"https://api.github.com/repos/betagouv/pix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/betagouv/pix/merges","archive_url":"https://api.github.com/repos/betagouv/pix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/betagouv/pix/downloads","issues_url":"https://api.github.com/repos/betagouv/pix/issues{/number}","pulls_url":"https://api.github.com/repos/betagouv/pix/pulls{/number}","milestones_url":"https://api.github.com/repos/betagouv/pix/milestones{/number}","notifications_url":"https://api.github.com/repos/betagouv/pix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/betagouv/pix/labels{/name}","releases_url":"https://api.github.com/repos/betagouv/pix/releases{/id}","deployments_url":"https://api.github.com/repos/betagouv/pix/deployments","created_at":"2016-07-11T12:31:15Z","updated_at":"2018-01-14T22:10:40Z","pushed_at":"2018-02-05T13:11:48Z","git_url":"git://github.com/betagouv/pix.git","ssh_url":"git@github.com:betagouv/pix.git","clone_url":"https://github.com/betagouv/pix.git","svn_url":"https://github.com/betagouv/pix","homepage":"https://pix.beta.gouv.fr","size":212289,"stargazers_count":39,"watchers_count":39,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":13,"mirror_url":null,"archived":false,"open_issues_count":8,"license":null,"forks":13,"open_issues":8,"watchers":39,"default_branch":"dev"}},"base":{"label":"betagouv:dev","ref":"dev","sha":"97d1f894dacdcce21a5da5501a308802efb6122e","user":{"login":"betagouv","id":7874148,"avatar_url":"https://avatars0.githubusercontent.com/u/7874148?v=4","gravatar_id":"","url":"https://api.github.com/users/betagouv","html_url":"https://github.com/betagouv","followers_url":"https://api.github.com/users/betagouv/followers","following_url":"https://api.github.com/users/betagouv/following{/other_user}","gists_url":"https://api.github.com/users/betagouv/gists{/gist_id}","starred_url":"https://api.github.com/users/betagouv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/betagouv/subscriptions","organizations_url":"https://api.github.com/users/betagouv/orgs","repos_url":"https://api.github.com/users/betagouv/repos","events_url":"https://api.github.com/users/betagouv/events{/privacy}","received_events_url":"https://api.github.com/users/betagouv/received_events","type":"Organization","site_admin":false},"repo":{"id":63066169,"name":"pix","full_name":"betagouv/pix","owner":{"login":"betagouv","id":7874148,"avatar_url":"https://avatars0.githubusercontent.com/u/7874148?v=4","gravatar_id":"","url":"https://api.github.com/users/betagouv","html_url":"https://github.com/betagouv","followers_url":"https://api.github.com/users/betagouv/followers","following_url":"https://api.github.com/users/betagouv/following{/other_user}","gists_url":"https://api.github.com/users/betagouv/gists{/gist_id}","starred_url":"https://api.github.com/users/betagouv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/betagouv/subscriptions","organizations_url":"https://api.github.com/users/betagouv/orgs","repos_url":"https://api.github.com/users/betagouv/repos","events_url":"https://api.github.com/users/betagouv/events{/privacy}","received_events_url":"https://api.github.com/users/betagouv/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/betagouv/pix","description":"Plateforme d'évaluation et de certification des compétences numériques à l'usage de tous les citoyens francophones.","fork":false,"url":"https://api.github.com/repos/betagouv/pix","forks_url":"https://api.github.com/repos/betagouv/pix/forks","keys_url":"https://api.github.com/repos/betagouv/pix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/betagouv/pix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/betagouv/pix/teams","hooks_url":"https://api.github.com/repos/betagouv/pix/hooks","issue_events_url":"https://api.github.com/repos/betagouv/pix/issues/events{/number}","events_url":"https://api.github.com/repos/betagouv/pix/events","assignees_url":"https://api.github.com/repos/betagouv/pix/assignees{/user}","branches_url":"https://api.github.com/repos/betagouv/pix/branches{/branch}","tags_url":"https://api.github.com/repos/betagouv/pix/tags","blobs_url":"https://api.github.com/repos/betagouv/pix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/betagouv/pix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/betagouv/pix/git/refs{/sha}","trees_url":"https://api.github.com/repos/betagouv/pix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/betagouv/pix/statuses/{sha}","languages_url":"https://api.github.com/repos/betagouv/pix/languages","stargazers_url":"https://api.github.com/repos/betagouv/pix/stargazers","contributors_url":"https://api.github.com/repos/betagouv/pix/contributors","subscribers_url":"https://api.github.com/repos/betagouv/pix/subscribers","subscription_url":"https://api.github.com/repos/betagouv/pix/subscription","commits_url":"https://api.github.com/repos/betagouv/pix/commits{/sha}","git_commits_url":"https://api.github.com/repos/betagouv/pix/git/commits{/sha}","comments_url":"https://api.github.com/repos/betagouv/pix/comments{/number}","issue_comment_url":"https://api.github.com/repos/betagouv/pix/issues/comments{/number}","contents_url":"https://api.github.com/repos/betagouv/pix/contents/{+path}","compare_url":"https://api.github.com/repos/betagouv/pix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/betagouv/pix/merges","archive_url":"https://api.github.com/repos/betagouv/pix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/betagouv/pix/downloads","issues_url":"https://api.github.com/repos/betagouv/pix/issues{/number}","pulls_url":"https://api.github.com/repos/betagouv/pix/pulls{/number}","milestones_url":"https://api.github.com/repos/betagouv/pix/milestones{/number}","notifications_url":"https://api.github.com/repos/betagouv/pix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/betagouv/pix/labels{/name}","releases_url":"https://api.github.com/repos/betagouv/pix/releases{/id}","deployments_url":"https://api.github.com/repos/betagouv/pix/deployments","created_at":"2016-07-11T12:31:15Z","updated_at":"2018-01-14T22:10:40Z","pushed_at":"2018-02-05T13:11:48Z","git_url":"git://github.com/betagouv/pix.git","ssh_url":"git@github.com:betagouv/pix.git","clone_url":"https://github.com/betagouv/pix.git","svn_url":"https://github.com/betagouv/pix","homepage":"https://pix.beta.gouv.fr","size":212289,"stargazers_count":39,"watchers_count":39,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":13,"mirror_url":null,"archived":false,"open_issues_count":8,"license":null,"forks":13,"open_issues":8,"watchers":39,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/betagouv/pix/pulls/672"},"html":{"href":"https://github.com/betagouv/pix/pull/672"},"issue":{"href":"https://api.github.com/repos/betagouv/pix/issues/672"},"comments":{"href":"https://api.github.com/repos/betagouv/pix/issues/672/comments"},"review_comments":{"href":"https://api.github.com/repos/betagouv/pix/pulls/672/comments"},"review_comment":{"href":"https://api.github.com/repos/betagouv/pix/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/betagouv/pix/pulls/672/commits"},"statuses":{"href":"https://api.github.com/repos/betagouv/pix/statuses/f46d56d1ba6b52bd9fa1540092e92b9f12055b31"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"mlaurent"}}