{"action":"created","comment":{"url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/pulls/comments/217500040","pull_request_review_id":155219630,"id":217500040,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNzUwMDA0MA==","diff_hunk":"@@ -0,0 +1,41 @@\n+from cornice.resource import Service\n+from pyramid.security import Allow, Everyone\n+from ..models import model_to_dict\n+from ..models.event import Event\n+from ..models.event_history import EventHistory\n+\n+\n+class ProfileHistoryFactory(object):\n+    def __init__(self, request):\n+        self.request = request\n+        self.owner_id = request.matchdict['user_id']\n+\n+    def __acl__(self):\n+        return [(Allow, self.owner_id, 'get')]\n+\n+profile_history = Service(name='profile-history',\n+                          path='/profile-history/{user_id}',\n+                          factory=ProfileHistoryFactory,\n+                          cors_origins=('http://localhost:3000',))\n+\n+\n+@profile_history.get()\n+def profile_history_get(request):\n+    response = {\n+        'success': False,\n+        'history': None\n+    }\n+\n+    events = Event.get_events_by_user_id(request, request.user.id)\n+    id_arr = [obj.id for obj in events]\n+    response['num_of_events'] = len(id_arr)\n+    history = EventHistory.\\\n+                    get_event_history_by_user_id(request, id_arr=id_arr)\n+    history_dict = [model_to_dict(obj) for obj in history]\n+    events_dict = [model_to_dict(obj) for obj in events]\n+\n+    response['events'] = events_dict\n+    response['history'] = history_dict\n+    response['success'] = True","path":"server/server/views/profile-history.py","position":39,"original_position":39,"commit_id":"dfb0cc1f45bbb90b700e95611e467a0baa39b599","original_commit_id":"dfb0cc1f45bbb90b700e95611e467a0baa39b599","user":{"login":"Merteg","id":18135784,"node_id":"MDQ6VXNlcjE4MTM1Nzg0","avatar_url":"https://avatars2.githubusercontent.com/u/18135784?v=4","gravatar_id":"","url":"https://api.github.com/users/Merteg","html_url":"https://github.com/Merteg","followers_url":"https://api.github.com/users/Merteg/followers","following_url":"https://api.github.com/users/Merteg/following{/other_user}","gists_url":"https://api.github.com/users/Merteg/gists{/gist_id}","starred_url":"https://api.github.com/users/Merteg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Merteg/subscriptions","organizations_url":"https://api.github.com/users/Merteg/orgs","repos_url":"https://api.github.com/users/Merteg/repos","events_url":"https://api.github.com/users/Merteg/events{/privacy}","received_events_url":"https://api.github.com/users/Merteg/received_events","type":"User","site_admin":false},"body":"You don't need to separate these expressions.","created_at":"2018-09-13T19:06:27Z","updated_at":"2018-09-13T19:08:30Z","html_url":"https://github.com/Social-projects-Rivne/Event.me/pull/43#discussion_r217500040","pull_request_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/pulls/43","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Social-projects-Rivne/Event.me/pulls/comments/217500040"},"html":{"href":"https://github.com/Social-projects-Rivne/Event.me/pull/43#discussion_r217500040"},"pull_request":{"href":"https://api.github.com/repos/Social-projects-Rivne/Event.me/pulls/43"}}},"pull_request":{"url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/pulls/43","id":215346605,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1MzQ2NjA1","html_url":"https://github.com/Social-projects-Rivne/Event.me/pull/43","diff_url":"https://github.com/Social-projects-Rivne/Event.me/pull/43.diff","patch_url":"https://github.com/Social-projects-Rivne/Event.me/pull/43.patch","issue_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/issues/43","number":43,"state":"open","locked":false,"title":"Feature/view profile history","user":{"login":"YaZhyvyi","id":20442228,"node_id":"MDQ6VXNlcjIwNDQyMjI4","avatar_url":"https://avatars3.githubusercontent.com/u/20442228?v=4","gravatar_id":"","url":"https://api.github.com/users/YaZhyvyi","html_url":"https://github.com/YaZhyvyi","followers_url":"https://api.github.com/users/YaZhyvyi/followers","following_url":"https://api.github.com/users/YaZhyvyi/following{/other_user}","gists_url":"https://api.github.com/users/YaZhyvyi/gists{/gist_id}","starred_url":"https://api.github.com/users/YaZhyvyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YaZhyvyi/subscriptions","organizations_url":"https://api.github.com/users/YaZhyvyi/orgs","repos_url":"https://api.github.com/users/YaZhyvyi/repos","events_url":"https://api.github.com/users/YaZhyvyi/events{/privacy}","received_events_url":"https://api.github.com/users/YaZhyvyi/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-09-13T16:47:28Z","updated_at":"2018-09-13T19:08:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d3be94451729378b114afbe2f07730f4abde081b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/pulls/43/commits","review_comments_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/pulls/43/comments","review_comment_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/issues/43/comments","statuses_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/statuses/dfb0cc1f45bbb90b700e95611e467a0baa39b599","head":{"label":"Social-projects-Rivne:feature/view-profile-history","ref":"feature/view-profile-history","sha":"dfb0cc1f45bbb90b700e95611e467a0baa39b599","user":{"login":"Social-projects-Rivne","id":13674166,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNjc0MTY2","avatar_url":"https://avatars3.githubusercontent.com/u/13674166?v=4","gravatar_id":"","url":"https://api.github.com/users/Social-projects-Rivne","html_url":"https://github.com/Social-projects-Rivne","followers_url":"https://api.github.com/users/Social-projects-Rivne/followers","following_url":"https://api.github.com/users/Social-projects-Rivne/following{/other_user}","gists_url":"https://api.github.com/users/Social-projects-Rivne/gists{/gist_id}","starred_url":"https://api.github.com/users/Social-projects-Rivne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Social-projects-Rivne/subscriptions","organizations_url":"https://api.github.com/users/Social-projects-Rivne/orgs","repos_url":"https://api.github.com/users/Social-projects-Rivne/repos","events_url":"https://api.github.com/users/Social-projects-Rivne/events{/privacy}","received_events_url":"https://api.github.com/users/Social-projects-Rivne/received_events","type":"Organization","site_admin":false},"repo":{"id":140434661,"node_id":"MDEwOlJlcG9zaXRvcnkxNDA0MzQ2NjE=","name":"Event.me","full_name":"Social-projects-Rivne/Event.me","owner":{"login":"Social-projects-Rivne","id":13674166,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNjc0MTY2","avatar_url":"https://avatars3.githubusercontent.com/u/13674166?v=4","gravatar_id":"","url":"https://api.github.com/users/Social-projects-Rivne","html_url":"https://github.com/Social-projects-Rivne","followers_url":"https://api.github.com/users/Social-projects-Rivne/followers","following_url":"https://api.github.com/users/Social-projects-Rivne/following{/other_user}","gists_url":"https://api.github.com/users/Social-projects-Rivne/gists{/gist_id}","starred_url":"https://api.github.com/users/Social-projects-Rivne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Social-projects-Rivne/subscriptions","organizations_url":"https://api.github.com/users/Social-projects-Rivne/orgs","repos_url":"https://api.github.com/users/Social-projects-Rivne/repos","events_url":"https://api.github.com/users/Social-projects-Rivne/events{/privacy}","received_events_url":"https://api.github.com/users/Social-projects-Rivne/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Social-projects-Rivne/Event.me","description":null,"fork":false,"url":"https://api.github.com/repos/Social-projects-Rivne/Event.me","forks_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/forks","keys_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/teams","hooks_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/hooks","issue_events_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/issues/events{/number}","events_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/events","assignees_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/assignees{/user}","branches_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/branches{/branch}","tags_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/tags","blobs_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/git/refs{/sha}","trees_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/statuses/{sha}","languages_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/languages","stargazers_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/stargazers","contributors_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/contributors","subscribers_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/subscribers","subscription_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/subscription","commits_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/commits{/sha}","git_commits_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/git/commits{/sha}","comments_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/comments{/number}","issue_comment_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/issues/comments{/number}","contents_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/contents/{+path}","compare_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/merges","archive_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/downloads","issues_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/issues{/number}","pulls_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/pulls{/number}","milestones_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/milestones{/number}","notifications_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/labels{/name}","releases_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/releases{/id}","deployments_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/deployments","created_at":"2018-07-10T13:15:40Z","updated_at":"2018-09-12T12:22:10Z","pushed_at":"2018-09-13T16:47:28Z","git_url":"git://github.com/Social-projects-Rivne/Event.me.git","ssh_url":"git@github.com:Social-projects-Rivne/Event.me.git","clone_url":"https://github.com/Social-projects-Rivne/Event.me.git","svn_url":"https://github.com/Social-projects-Rivne/Event.me","homepage":null,"size":22659,"stargazers_count":1,"watchers_count":1,"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":3,"license":null,"forks":0,"open_issues":3,"watchers":1,"default_branch":"dev"}},"base":{"label":"Social-projects-Rivne:dev","ref":"dev","sha":"6292f7ed80893f7a0592855579b72d3b89f929b5","user":{"login":"Social-projects-Rivne","id":13674166,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNjc0MTY2","avatar_url":"https://avatars3.githubusercontent.com/u/13674166?v=4","gravatar_id":"","url":"https://api.github.com/users/Social-projects-Rivne","html_url":"https://github.com/Social-projects-Rivne","followers_url":"https://api.github.com/users/Social-projects-Rivne/followers","following_url":"https://api.github.com/users/Social-projects-Rivne/following{/other_user}","gists_url":"https://api.github.com/users/Social-projects-Rivne/gists{/gist_id}","starred_url":"https://api.github.com/users/Social-projects-Rivne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Social-projects-Rivne/subscriptions","organizations_url":"https://api.github.com/users/Social-projects-Rivne/orgs","repos_url":"https://api.github.com/users/Social-projects-Rivne/repos","events_url":"https://api.github.com/users/Social-projects-Rivne/events{/privacy}","received_events_url":"https://api.github.com/users/Social-projects-Rivne/received_events","type":"Organization","site_admin":false},"repo":{"id":140434661,"node_id":"MDEwOlJlcG9zaXRvcnkxNDA0MzQ2NjE=","name":"Event.me","full_name":"Social-projects-Rivne/Event.me","owner":{"login":"Social-projects-Rivne","id":13674166,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzNjc0MTY2","avatar_url":"https://avatars3.githubusercontent.com/u/13674166?v=4","gravatar_id":"","url":"https://api.github.com/users/Social-projects-Rivne","html_url":"https://github.com/Social-projects-Rivne","followers_url":"https://api.github.com/users/Social-projects-Rivne/followers","following_url":"https://api.github.com/users/Social-projects-Rivne/following{/other_user}","gists_url":"https://api.github.com/users/Social-projects-Rivne/gists{/gist_id}","starred_url":"https://api.github.com/users/Social-projects-Rivne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Social-projects-Rivne/subscriptions","organizations_url":"https://api.github.com/users/Social-projects-Rivne/orgs","repos_url":"https://api.github.com/users/Social-projects-Rivne/repos","events_url":"https://api.github.com/users/Social-projects-Rivne/events{/privacy}","received_events_url":"https://api.github.com/users/Social-projects-Rivne/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Social-projects-Rivne/Event.me","description":null,"fork":false,"url":"https://api.github.com/repos/Social-projects-Rivne/Event.me","forks_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/forks","keys_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/teams","hooks_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/hooks","issue_events_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/issues/events{/number}","events_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/events","assignees_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/assignees{/user}","branches_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/branches{/branch}","tags_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/tags","blobs_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/git/refs{/sha}","trees_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/statuses/{sha}","languages_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/languages","stargazers_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/stargazers","contributors_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/contributors","subscribers_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/subscribers","subscription_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/subscription","commits_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/commits{/sha}","git_commits_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/git/commits{/sha}","comments_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/comments{/number}","issue_comment_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/issues/comments{/number}","contents_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/contents/{+path}","compare_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/merges","archive_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/downloads","issues_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/issues{/number}","pulls_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/pulls{/number}","milestones_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/milestones{/number}","notifications_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/labels{/name}","releases_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/releases{/id}","deployments_url":"https://api.github.com/repos/Social-projects-Rivne/Event.me/deployments","created_at":"2018-07-10T13:15:40Z","updated_at":"2018-09-12T12:22:10Z","pushed_at":"2018-09-13T16:47:28Z","git_url":"git://github.com/Social-projects-Rivne/Event.me.git","ssh_url":"git@github.com:Social-projects-Rivne/Event.me.git","clone_url":"https://github.com/Social-projects-Rivne/Event.me.git","svn_url":"https://github.com/Social-projects-Rivne/Event.me","homepage":null,"size":22659,"stargazers_count":1,"watchers_count":1,"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":3,"license":null,"forks":0,"open_issues":3,"watchers":1,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/Social-projects-Rivne/Event.me/pulls/43"},"html":{"href":"https://github.com/Social-projects-Rivne/Event.me/pull/43"},"issue":{"href":"https://api.github.com/repos/Social-projects-Rivne/Event.me/issues/43"},"comments":{"href":"https://api.github.com/repos/Social-projects-Rivne/Event.me/issues/43/comments"},"review_comments":{"href":"https://api.github.com/repos/Social-projects-Rivne/Event.me/pulls/43/comments"},"review_comment":{"href":"https://api.github.com/repos/Social-projects-Rivne/Event.me/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Social-projects-Rivne/Event.me/pulls/43/commits"},"statuses":{"href":"https://api.github.com/repos/Social-projects-Rivne/Event.me/statuses/dfb0cc1f45bbb90b700e95611e467a0baa39b599"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Merteg"}}