{"action":"created","comment":{"url":"https://api.github.com/repos/ExtensionEngine/boutique/pulls/comments/228468316","pull_request_review_id":168744497,"id":228468316,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyODQ2ODMxNg==","diff_hunk":"@@ -87,12 +90,39 @@ function resetPassword({ body, params }, res) {\n     .then(() => res.end());\n }\n \n+async function importUsers(req, res) {\n+  const errors = [];\n+  const origin = req.origin();\n+  const users = await getUsers(req.file);\n+  const opts = {\n+    where: { email: map(users, user => user.email) },\n+    paranoid: false\n+  };\n+  const existingUsers = await User.findAll(opts);\n+  await Promise.map(users, user => {\n+    const existingUser = find(existingUsers, user);\n+    if (existingUser && !existingUser.deletedAt) {\n+      return errors.push(`User ${user.email}: Already exists!`);\n+    }\n+    return User.invite(pick(user, inputAttrs), { existingUser, origin })\n+      .catch(err => errors.push(`User ${user.email}: ${err.message}!`));\n+  });\n+  if (errors.length) {","path":"server/user/user.controller.js","position":35,"original_position":35,"commit_id":"764310f733f98a8a2e7e68a87b4ce2fbca84ae56","original_commit_id":"764310f733f98a8a2e7e68a87b4ce2fbca84ae56","user":{"login":"vladimyr","id":1170440,"node_id":"MDQ6VXNlcjExNzA0NDA=","avatar_url":"https://avatars1.githubusercontent.com/u/1170440?v=4","gravatar_id":"","url":"https://api.github.com/users/vladimyr","html_url":"https://github.com/vladimyr","followers_url":"https://api.github.com/users/vladimyr/followers","following_url":"https://api.github.com/users/vladimyr/following{/other_user}","gists_url":"https://api.github.com/users/vladimyr/gists{/gist_id}","starred_url":"https://api.github.com/users/vladimyr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vladimyr/subscriptions","organizations_url":"https://api.github.com/users/vladimyr/orgs","repos_url":"https://api.github.com/users/vladimyr/repos","events_url":"https://api.github.com/users/vladimyr/events{/privacy}","received_events_url":"https://api.github.com/users/vladimyr/received_events","type":"User","site_admin":false},"body":"Swap condition and make early return to avoid indentation :wink: ","created_at":"2018-10-26T09:48:49Z","updated_at":"2018-10-26T09:49:11Z","html_url":"https://github.com/ExtensionEngine/boutique/pull/44#discussion_r228468316","pull_request_url":"https://api.github.com/repos/ExtensionEngine/boutique/pulls/44","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ExtensionEngine/boutique/pulls/comments/228468316"},"html":{"href":"https://github.com/ExtensionEngine/boutique/pull/44#discussion_r228468316"},"pull_request":{"href":"https://api.github.com/repos/ExtensionEngine/boutique/pulls/44"}}},"pull_request":{"url":"https://api.github.com/repos/ExtensionEngine/boutique/pulls/44","id":225004282,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI1MDA0Mjgy","html_url":"https://github.com/ExtensionEngine/boutique/pull/44","diff_url":"https://github.com/ExtensionEngine/boutique/pull/44.diff","patch_url":"https://github.com/ExtensionEngine/boutique/pull/44.patch","issue_url":"https://api.github.com/repos/ExtensionEngine/boutique/issues/44","number":44,"state":"open","locked":false,"title":"Import users","user":{"login":"franosincic","id":10136836,"node_id":"MDQ6VXNlcjEwMTM2ODM2","avatar_url":"https://avatars2.githubusercontent.com/u/10136836?v=4","gravatar_id":"","url":"https://api.github.com/users/franosincic","html_url":"https://github.com/franosincic","followers_url":"https://api.github.com/users/franosincic/followers","following_url":"https://api.github.com/users/franosincic/following{/other_user}","gists_url":"https://api.github.com/users/franosincic/gists{/gist_id}","starred_url":"https://api.github.com/users/franosincic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/franosincic/subscriptions","organizations_url":"https://api.github.com/users/franosincic/orgs","repos_url":"https://api.github.com/users/franosincic/repos","events_url":"https://api.github.com/users/franosincic/events{/privacy}","received_events_url":"https://api.github.com/users/franosincic/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-23T11:41:48Z","updated_at":"2018-10-26T09:49:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"49cae70141865932e7a6a62d483ee3996c8628ef","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":888264458,"node_id":"MDU6TGFiZWw4ODgyNjQ0NTg=","url":"https://api.github.com/repos/ExtensionEngine/boutique/labels/in%20progress","name":"in progress","color":"fbca04","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ExtensionEngine/boutique/pulls/44/commits","review_comments_url":"https://api.github.com/repos/ExtensionEngine/boutique/pulls/44/comments","review_comment_url":"https://api.github.com/repos/ExtensionEngine/boutique/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ExtensionEngine/boutique/issues/44/comments","statuses_url":"https://api.github.com/repos/ExtensionEngine/boutique/statuses/764310f733f98a8a2e7e68a87b4ce2fbca84ae56","head":{"label":"ExtensionEngine:feature/import-users","ref":"feature/import-users","sha":"764310f733f98a8a2e7e68a87b4ce2fbca84ae56","user":{"login":"ExtensionEngine","id":2768813,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3Njg4MTM=","avatar_url":"https://avatars2.githubusercontent.com/u/2768813?v=4","gravatar_id":"","url":"https://api.github.com/users/ExtensionEngine","html_url":"https://github.com/ExtensionEngine","followers_url":"https://api.github.com/users/ExtensionEngine/followers","following_url":"https://api.github.com/users/ExtensionEngine/following{/other_user}","gists_url":"https://api.github.com/users/ExtensionEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/ExtensionEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ExtensionEngine/subscriptions","organizations_url":"https://api.github.com/users/ExtensionEngine/orgs","repos_url":"https://api.github.com/users/ExtensionEngine/repos","events_url":"https://api.github.com/users/ExtensionEngine/events{/privacy}","received_events_url":"https://api.github.com/users/ExtensionEngine/received_events","type":"Organization","site_admin":false},"repo":{"id":127158304,"node_id":"MDEwOlJlcG9zaXRvcnkxMjcxNTgzMDQ=","name":"boutique","full_name":"ExtensionEngine/boutique","private":false,"owner":{"login":"ExtensionEngine","id":2768813,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3Njg4MTM=","avatar_url":"https://avatars2.githubusercontent.com/u/2768813?v=4","gravatar_id":"","url":"https://api.github.com/users/ExtensionEngine","html_url":"https://github.com/ExtensionEngine","followers_url":"https://api.github.com/users/ExtensionEngine/followers","following_url":"https://api.github.com/users/ExtensionEngine/following{/other_user}","gists_url":"https://api.github.com/users/ExtensionEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/ExtensionEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ExtensionEngine/subscriptions","organizations_url":"https://api.github.com/users/ExtensionEngine/orgs","repos_url":"https://api.github.com/users/ExtensionEngine/repos","events_url":"https://api.github.com/users/ExtensionEngine/events{/privacy}","received_events_url":"https://api.github.com/users/ExtensionEngine/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ExtensionEngine/boutique","description":null,"fork":false,"url":"https://api.github.com/repos/ExtensionEngine/boutique","forks_url":"https://api.github.com/repos/ExtensionEngine/boutique/forks","keys_url":"https://api.github.com/repos/ExtensionEngine/boutique/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ExtensionEngine/boutique/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ExtensionEngine/boutique/teams","hooks_url":"https://api.github.com/repos/ExtensionEngine/boutique/hooks","issue_events_url":"https://api.github.com/repos/ExtensionEngine/boutique/issues/events{/number}","events_url":"https://api.github.com/repos/ExtensionEngine/boutique/events","assignees_url":"https://api.github.com/repos/ExtensionEngine/boutique/assignees{/user}","branches_url":"https://api.github.com/repos/ExtensionEngine/boutique/branches{/branch}","tags_url":"https://api.github.com/repos/ExtensionEngine/boutique/tags","blobs_url":"https://api.github.com/repos/ExtensionEngine/boutique/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ExtensionEngine/boutique/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ExtensionEngine/boutique/git/refs{/sha}","trees_url":"https://api.github.com/repos/ExtensionEngine/boutique/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ExtensionEngine/boutique/statuses/{sha}","languages_url":"https://api.github.com/repos/ExtensionEngine/boutique/languages","stargazers_url":"https://api.github.com/repos/ExtensionEngine/boutique/stargazers","contributors_url":"https://api.github.com/repos/ExtensionEngine/boutique/contributors","subscribers_url":"https://api.github.com/repos/ExtensionEngine/boutique/subscribers","subscription_url":"https://api.github.com/repos/ExtensionEngine/boutique/subscription","commits_url":"https://api.github.com/repos/ExtensionEngine/boutique/commits{/sha}","git_commits_url":"https://api.github.com/repos/ExtensionEngine/boutique/git/commits{/sha}","comments_url":"https://api.github.com/repos/ExtensionEngine/boutique/comments{/number}","issue_comment_url":"https://api.github.com/repos/ExtensionEngine/boutique/issues/comments{/number}","contents_url":"https://api.github.com/repos/ExtensionEngine/boutique/contents/{+path}","compare_url":"https://api.github.com/repos/ExtensionEngine/boutique/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ExtensionEngine/boutique/merges","archive_url":"https://api.github.com/repos/ExtensionEngine/boutique/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ExtensionEngine/boutique/downloads","issues_url":"https://api.github.com/repos/ExtensionEngine/boutique/issues{/number}","pulls_url":"https://api.github.com/repos/ExtensionEngine/boutique/pulls{/number}","milestones_url":"https://api.github.com/repos/ExtensionEngine/boutique/milestones{/number}","notifications_url":"https://api.github.com/repos/ExtensionEngine/boutique/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ExtensionEngine/boutique/labels{/name}","releases_url":"https://api.github.com/repos/ExtensionEngine/boutique/releases{/id}","deployments_url":"https://api.github.com/repos/ExtensionEngine/boutique/deployments","created_at":"2018-03-28T15:08:55Z","updated_at":"2018-10-25T10:36:49Z","pushed_at":"2018-10-26T08:58:26Z","git_url":"git://github.com/ExtensionEngine/boutique.git","ssh_url":"git@github.com:ExtensionEngine/boutique.git","clone_url":"https://github.com/ExtensionEngine/boutique.git","svn_url":"https://github.com/ExtensionEngine/boutique","homepage":null,"size":2380,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":5,"watchers":0,"default_branch":"develop"}},"base":{"label":"ExtensionEngine:develop","ref":"develop","sha":"6cc1148a86c7cafef6b40faa78cf97d975714d91","user":{"login":"ExtensionEngine","id":2768813,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3Njg4MTM=","avatar_url":"https://avatars2.githubusercontent.com/u/2768813?v=4","gravatar_id":"","url":"https://api.github.com/users/ExtensionEngine","html_url":"https://github.com/ExtensionEngine","followers_url":"https://api.github.com/users/ExtensionEngine/followers","following_url":"https://api.github.com/users/ExtensionEngine/following{/other_user}","gists_url":"https://api.github.com/users/ExtensionEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/ExtensionEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ExtensionEngine/subscriptions","organizations_url":"https://api.github.com/users/ExtensionEngine/orgs","repos_url":"https://api.github.com/users/ExtensionEngine/repos","events_url":"https://api.github.com/users/ExtensionEngine/events{/privacy}","received_events_url":"https://api.github.com/users/ExtensionEngine/received_events","type":"Organization","site_admin":false},"repo":{"id":127158304,"node_id":"MDEwOlJlcG9zaXRvcnkxMjcxNTgzMDQ=","name":"boutique","full_name":"ExtensionEngine/boutique","private":false,"owner":{"login":"ExtensionEngine","id":2768813,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3Njg4MTM=","avatar_url":"https://avatars2.githubusercontent.com/u/2768813?v=4","gravatar_id":"","url":"https://api.github.com/users/ExtensionEngine","html_url":"https://github.com/ExtensionEngine","followers_url":"https://api.github.com/users/ExtensionEngine/followers","following_url":"https://api.github.com/users/ExtensionEngine/following{/other_user}","gists_url":"https://api.github.com/users/ExtensionEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/ExtensionEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ExtensionEngine/subscriptions","organizations_url":"https://api.github.com/users/ExtensionEngine/orgs","repos_url":"https://api.github.com/users/ExtensionEngine/repos","events_url":"https://api.github.com/users/ExtensionEngine/events{/privacy}","received_events_url":"https://api.github.com/users/ExtensionEngine/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ExtensionEngine/boutique","description":null,"fork":false,"url":"https://api.github.com/repos/ExtensionEngine/boutique","forks_url":"https://api.github.com/repos/ExtensionEngine/boutique/forks","keys_url":"https://api.github.com/repos/ExtensionEngine/boutique/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ExtensionEngine/boutique/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ExtensionEngine/boutique/teams","hooks_url":"https://api.github.com/repos/ExtensionEngine/boutique/hooks","issue_events_url":"https://api.github.com/repos/ExtensionEngine/boutique/issues/events{/number}","events_url":"https://api.github.com/repos/ExtensionEngine/boutique/events","assignees_url":"https://api.github.com/repos/ExtensionEngine/boutique/assignees{/user}","branches_url":"https://api.github.com/repos/ExtensionEngine/boutique/branches{/branch}","tags_url":"https://api.github.com/repos/ExtensionEngine/boutique/tags","blobs_url":"https://api.github.com/repos/ExtensionEngine/boutique/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ExtensionEngine/boutique/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ExtensionEngine/boutique/git/refs{/sha}","trees_url":"https://api.github.com/repos/ExtensionEngine/boutique/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ExtensionEngine/boutique/statuses/{sha}","languages_url":"https://api.github.com/repos/ExtensionEngine/boutique/languages","stargazers_url":"https://api.github.com/repos/ExtensionEngine/boutique/stargazers","contributors_url":"https://api.github.com/repos/ExtensionEngine/boutique/contributors","subscribers_url":"https://api.github.com/repos/ExtensionEngine/boutique/subscribers","subscription_url":"https://api.github.com/repos/ExtensionEngine/boutique/subscription","commits_url":"https://api.github.com/repos/ExtensionEngine/boutique/commits{/sha}","git_commits_url":"https://api.github.com/repos/ExtensionEngine/boutique/git/commits{/sha}","comments_url":"https://api.github.com/repos/ExtensionEngine/boutique/comments{/number}","issue_comment_url":"https://api.github.com/repos/ExtensionEngine/boutique/issues/comments{/number}","contents_url":"https://api.github.com/repos/ExtensionEngine/boutique/contents/{+path}","compare_url":"https://api.github.com/repos/ExtensionEngine/boutique/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ExtensionEngine/boutique/merges","archive_url":"https://api.github.com/repos/ExtensionEngine/boutique/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ExtensionEngine/boutique/downloads","issues_url":"https://api.github.com/repos/ExtensionEngine/boutique/issues{/number}","pulls_url":"https://api.github.com/repos/ExtensionEngine/boutique/pulls{/number}","milestones_url":"https://api.github.com/repos/ExtensionEngine/boutique/milestones{/number}","notifications_url":"https://api.github.com/repos/ExtensionEngine/boutique/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ExtensionEngine/boutique/labels{/name}","releases_url":"https://api.github.com/repos/ExtensionEngine/boutique/releases{/id}","deployments_url":"https://api.github.com/repos/ExtensionEngine/boutique/deployments","created_at":"2018-03-28T15:08:55Z","updated_at":"2018-10-25T10:36:49Z","pushed_at":"2018-10-26T08:58:26Z","git_url":"git://github.com/ExtensionEngine/boutique.git","ssh_url":"git@github.com:ExtensionEngine/boutique.git","clone_url":"https://github.com/ExtensionEngine/boutique.git","svn_url":"https://github.com/ExtensionEngine/boutique","homepage":null,"size":2380,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":5,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ExtensionEngine/boutique/pulls/44"},"html":{"href":"https://github.com/ExtensionEngine/boutique/pull/44"},"issue":{"href":"https://api.github.com/repos/ExtensionEngine/boutique/issues/44"},"comments":{"href":"https://api.github.com/repos/ExtensionEngine/boutique/issues/44/comments"},"review_comments":{"href":"https://api.github.com/repos/ExtensionEngine/boutique/pulls/44/comments"},"review_comment":{"href":"https://api.github.com/repos/ExtensionEngine/boutique/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ExtensionEngine/boutique/pulls/44/commits"},"statuses":{"href":"https://api.github.com/repos/ExtensionEngine/boutique/statuses/764310f733f98a8a2e7e68a87b4ce2fbca84ae56"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"vladimyr"}}