{"action":"created","comment":{"url":"https://api.github.com/repos/indico/indico/pulls/comments/192038160","pull_request_review_id":124728408,"id":192038160,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MjAzODE2MA==","diff_hunk":"@@ -102,13 +103,19 @@ class RHTimeline(RHRoomBookingBase):\n     })\n     def _process(self, args):\n         rooms = Room.query.filter(Room.is_active, Room.id.in_(args.pop('room_ids')))\n-        availabilities = get_rooms_availability(rooms, **args)\n-        for availability in availabilities:\n-            availability['room'] = rooms_schema.dump(availability['room'], many=False).data\n-            availability['occurrences'] = reservation_occurrences_schema.dump(availability['occurrences']).data\n-            availability['conflicts'] = reservation_occurrences_schema.dump(availability['conflicts']).data\n-            availability['pre_conflicts'] = reservation_occurrences_schema.dump(availability['pre_conflicts']).data\n-        return jsonify(availabilities)\n+        date_range, availability = get_rooms_availability(rooms, **args)\n+        date_range = [dt.isoformat() for dt in date_range]\n+        for room_availability in availability:\n+            data = availability[room_availability]\n+            data['candidates'] = self._serialize_occurrences(data['candidates'])\n+            data['pre_bookings'] = self._serialize_occurrences(data['pre_bookings'])\n+            data['bookings'] = self._serialize_occurrences(data['bookings'])\n+            data['conflicts'] = self._serialize_occurrences(data['conflicts'])\n+            data['pre_conflicts'] = self._serialize_occurrences(data['pre_conflicts'])","path":"indico/modules/rb_new/controllers/backend.py","position":27,"original_position":27,"commit_id":"d4ccb6bc885a00e24715ad6fece964cb6e4339ca","original_commit_id":"27c315b2a82311757fe6f17f071b5d1f8505fd45","user":{"login":"pferreir","id":2699,"node_id":"MDQ6VXNlcjI2OTk=","avatar_url":"https://avatars3.githubusercontent.com/u/2699?v=4","gravatar_id":"","url":"https://api.github.com/users/pferreir","html_url":"https://github.com/pferreir","followers_url":"https://api.github.com/users/pferreir/followers","following_url":"https://api.github.com/users/pferreir/following{/other_user}","gists_url":"https://api.github.com/users/pferreir/gists{/gist_id}","starred_url":"https://api.github.com/users/pferreir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pferreir/subscriptions","organizations_url":"https://api.github.com/users/pferreir/orgs","repos_url":"https://api.github.com/users/pferreir/repos","events_url":"https://api.github.com/users/pferreir/events{/privacy}","received_events_url":"https://api.github.com/users/pferreir/received_events","type":"User","site_admin":false},"body":"Just a matter of style, I'd probably have used something like:\r\n```python\r\ndata.update({k: self._serialize_occurrences(data[k]) for k in ['candidates', 'pre_booking', '...']})\r\n```","created_at":"2018-05-31T09:22:21Z","updated_at":"2018-05-31T09:22:45Z","html_url":"https://github.com/indico/indico/pull/3382#discussion_r192038160","pull_request_url":"https://api.github.com/repos/indico/indico/pulls/3382","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/indico/indico/pulls/comments/192038160"},"html":{"href":"https://github.com/indico/indico/pull/3382#discussion_r192038160"},"pull_request":{"href":"https://api.github.com/repos/indico/indico/pulls/3382"}}},"pull_request":{"url":"https://api.github.com/repos/indico/indico/pulls/3382","id":191443652,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkxNDQzNjUy","html_url":"https://github.com/indico/indico/pull/3382","diff_url":"https://github.com/indico/indico/pull/3382.diff","patch_url":"https://github.com/indico/indico/pull/3382.patch","issue_url":"https://api.github.com/repos/indico/indico/issues/3382","number":3382,"state":"open","locked":false,"title":"Timeline view","user":{"login":"mic4ael","id":3616940,"node_id":"MDQ6VXNlcjM2MTY5NDA=","avatar_url":"https://avatars0.githubusercontent.com/u/3616940?v=4","gravatar_id":"","url":"https://api.github.com/users/mic4ael","html_url":"https://github.com/mic4ael","followers_url":"https://api.github.com/users/mic4ael/followers","following_url":"https://api.github.com/users/mic4ael/following{/other_user}","gists_url":"https://api.github.com/users/mic4ael/gists{/gist_id}","starred_url":"https://api.github.com/users/mic4ael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mic4ael/subscriptions","organizations_url":"https://api.github.com/users/mic4ael/orgs","repos_url":"https://api.github.com/users/mic4ael/repos","events_url":"https://api.github.com/users/mic4ael/events{/privacy}","received_events_url":"https://api.github.com/users/mic4ael/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-05-30T12:57:56Z","updated_at":"2018-05-31T09:22:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b3091fb6b8a24d90fda2a02be2a25d6d68809412","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/indico/indico/pulls/3382/commits","review_comments_url":"https://api.github.com/repos/indico/indico/pulls/3382/comments","review_comment_url":"https://api.github.com/repos/indico/indico/pulls/comments{/number}","comments_url":"https://api.github.com/repos/indico/indico/issues/3382/comments","statuses_url":"https://api.github.com/repos/indico/indico/statuses/d4ccb6bc885a00e24715ad6fece964cb6e4339ca","head":{"label":"mic4ael:new-rb","ref":"new-rb","sha":"d4ccb6bc885a00e24715ad6fece964cb6e4339ca","user":{"login":"mic4ael","id":3616940,"node_id":"MDQ6VXNlcjM2MTY5NDA=","avatar_url":"https://avatars0.githubusercontent.com/u/3616940?v=4","gravatar_id":"","url":"https://api.github.com/users/mic4ael","html_url":"https://github.com/mic4ael","followers_url":"https://api.github.com/users/mic4ael/followers","following_url":"https://api.github.com/users/mic4ael/following{/other_user}","gists_url":"https://api.github.com/users/mic4ael/gists{/gist_id}","starred_url":"https://api.github.com/users/mic4ael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mic4ael/subscriptions","organizations_url":"https://api.github.com/users/mic4ael/orgs","repos_url":"https://api.github.com/users/mic4ael/repos","events_url":"https://api.github.com/users/mic4ael/events{/privacy}","received_events_url":"https://api.github.com/users/mic4ael/received_events","type":"User","site_admin":false},"repo":{"id":36723985,"node_id":"MDEwOlJlcG9zaXRvcnkzNjcyMzk4NQ==","name":"indico","full_name":"mic4ael/indico","owner":{"login":"mic4ael","id":3616940,"node_id":"MDQ6VXNlcjM2MTY5NDA=","avatar_url":"https://avatars0.githubusercontent.com/u/3616940?v=4","gravatar_id":"","url":"https://api.github.com/users/mic4ael","html_url":"https://github.com/mic4ael","followers_url":"https://api.github.com/users/mic4ael/followers","following_url":"https://api.github.com/users/mic4ael/following{/other_user}","gists_url":"https://api.github.com/users/mic4ael/gists{/gist_id}","starred_url":"https://api.github.com/users/mic4ael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mic4ael/subscriptions","organizations_url":"https://api.github.com/users/mic4ael/orgs","repos_url":"https://api.github.com/users/mic4ael/repos","events_url":"https://api.github.com/users/mic4ael/events{/privacy}","received_events_url":"https://api.github.com/users/mic4ael/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mic4ael/indico","description":"The Indico Project","fork":true,"url":"https://api.github.com/repos/mic4ael/indico","forks_url":"https://api.github.com/repos/mic4ael/indico/forks","keys_url":"https://api.github.com/repos/mic4ael/indico/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mic4ael/indico/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mic4ael/indico/teams","hooks_url":"https://api.github.com/repos/mic4ael/indico/hooks","issue_events_url":"https://api.github.com/repos/mic4ael/indico/issues/events{/number}","events_url":"https://api.github.com/repos/mic4ael/indico/events","assignees_url":"https://api.github.com/repos/mic4ael/indico/assignees{/user}","branches_url":"https://api.github.com/repos/mic4ael/indico/branches{/branch}","tags_url":"https://api.github.com/repos/mic4ael/indico/tags","blobs_url":"https://api.github.com/repos/mic4ael/indico/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mic4ael/indico/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mic4ael/indico/git/refs{/sha}","trees_url":"https://api.github.com/repos/mic4ael/indico/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mic4ael/indico/statuses/{sha}","languages_url":"https://api.github.com/repos/mic4ael/indico/languages","stargazers_url":"https://api.github.com/repos/mic4ael/indico/stargazers","contributors_url":"https://api.github.com/repos/mic4ael/indico/contributors","subscribers_url":"https://api.github.com/repos/mic4ael/indico/subscribers","subscription_url":"https://api.github.com/repos/mic4ael/indico/subscription","commits_url":"https://api.github.com/repos/mic4ael/indico/commits{/sha}","git_commits_url":"https://api.github.com/repos/mic4ael/indico/git/commits{/sha}","comments_url":"https://api.github.com/repos/mic4ael/indico/comments{/number}","issue_comment_url":"https://api.github.com/repos/mic4ael/indico/issues/comments{/number}","contents_url":"https://api.github.com/repos/mic4ael/indico/contents/{+path}","compare_url":"https://api.github.com/repos/mic4ael/indico/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mic4ael/indico/merges","archive_url":"https://api.github.com/repos/mic4ael/indico/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mic4ael/indico/downloads","issues_url":"https://api.github.com/repos/mic4ael/indico/issues{/number}","pulls_url":"https://api.github.com/repos/mic4ael/indico/pulls{/number}","milestones_url":"https://api.github.com/repos/mic4ael/indico/milestones{/number}","notifications_url":"https://api.github.com/repos/mic4ael/indico/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mic4ael/indico/labels{/name}","releases_url":"https://api.github.com/repos/mic4ael/indico/releases{/id}","deployments_url":"https://api.github.com/repos/mic4ael/indico/deployments","created_at":"2015-06-02T09:51:56Z","updated_at":"2016-01-12T07:28:37Z","pushed_at":"2018-05-31T09:22:35Z","git_url":"git://github.com/mic4ael/indico.git","ssh_url":"git@github.com:mic4ael/indico.git","clone_url":"https://github.com/mic4ael/indico.git","svn_url":"https://github.com/mic4ael/indico","homepage":"http://indico-software.org","size":203862,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"indico:new-rb","ref":"new-rb","sha":"42b749084c814d928a721d823781c5004828d61d","user":{"login":"indico","id":715236,"node_id":"MDEyOk9yZ2FuaXphdGlvbjcxNTIzNg==","avatar_url":"https://avatars2.githubusercontent.com/u/715236?v=4","gravatar_id":"","url":"https://api.github.com/users/indico","html_url":"https://github.com/indico","followers_url":"https://api.github.com/users/indico/followers","following_url":"https://api.github.com/users/indico/following{/other_user}","gists_url":"https://api.github.com/users/indico/gists{/gist_id}","starred_url":"https://api.github.com/users/indico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indico/subscriptions","organizations_url":"https://api.github.com/users/indico/orgs","repos_url":"https://api.github.com/users/indico/repos","events_url":"https://api.github.com/users/indico/events{/privacy}","received_events_url":"https://api.github.com/users/indico/received_events","type":"Organization","site_admin":false},"repo":{"id":2113067,"node_id":"MDEwOlJlcG9zaXRvcnkyMTEzMDY3","name":"indico","full_name":"indico/indico","owner":{"login":"indico","id":715236,"node_id":"MDEyOk9yZ2FuaXphdGlvbjcxNTIzNg==","avatar_url":"https://avatars2.githubusercontent.com/u/715236?v=4","gravatar_id":"","url":"https://api.github.com/users/indico","html_url":"https://github.com/indico","followers_url":"https://api.github.com/users/indico/followers","following_url":"https://api.github.com/users/indico/following{/other_user}","gists_url":"https://api.github.com/users/indico/gists{/gist_id}","starred_url":"https://api.github.com/users/indico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/indico/subscriptions","organizations_url":"https://api.github.com/users/indico/orgs","repos_url":"https://api.github.com/users/indico/repos","events_url":"https://api.github.com/users/indico/events{/privacy}","received_events_url":"https://api.github.com/users/indico/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/indico/indico","description":"Indico - A complete event management system","fork":false,"url":"https://api.github.com/repos/indico/indico","forks_url":"https://api.github.com/repos/indico/indico/forks","keys_url":"https://api.github.com/repos/indico/indico/keys{/key_id}","collaborators_url":"https://api.github.com/repos/indico/indico/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/indico/indico/teams","hooks_url":"https://api.github.com/repos/indico/indico/hooks","issue_events_url":"https://api.github.com/repos/indico/indico/issues/events{/number}","events_url":"https://api.github.com/repos/indico/indico/events","assignees_url":"https://api.github.com/repos/indico/indico/assignees{/user}","branches_url":"https://api.github.com/repos/indico/indico/branches{/branch}","tags_url":"https://api.github.com/repos/indico/indico/tags","blobs_url":"https://api.github.com/repos/indico/indico/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/indico/indico/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/indico/indico/git/refs{/sha}","trees_url":"https://api.github.com/repos/indico/indico/git/trees{/sha}","statuses_url":"https://api.github.com/repos/indico/indico/statuses/{sha}","languages_url":"https://api.github.com/repos/indico/indico/languages","stargazers_url":"https://api.github.com/repos/indico/indico/stargazers","contributors_url":"https://api.github.com/repos/indico/indico/contributors","subscribers_url":"https://api.github.com/repos/indico/indico/subscribers","subscription_url":"https://api.github.com/repos/indico/indico/subscription","commits_url":"https://api.github.com/repos/indico/indico/commits{/sha}","git_commits_url":"https://api.github.com/repos/indico/indico/git/commits{/sha}","comments_url":"https://api.github.com/repos/indico/indico/comments{/number}","issue_comment_url":"https://api.github.com/repos/indico/indico/issues/comments{/number}","contents_url":"https://api.github.com/repos/indico/indico/contents/{+path}","compare_url":"https://api.github.com/repos/indico/indico/compare/{base}...{head}","merges_url":"https://api.github.com/repos/indico/indico/merges","archive_url":"https://api.github.com/repos/indico/indico/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/indico/indico/downloads","issues_url":"https://api.github.com/repos/indico/indico/issues{/number}","pulls_url":"https://api.github.com/repos/indico/indico/pulls{/number}","milestones_url":"https://api.github.com/repos/indico/indico/milestones{/number}","notifications_url":"https://api.github.com/repos/indico/indico/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/indico/indico/labels{/name}","releases_url":"https://api.github.com/repos/indico/indico/releases{/id}","deployments_url":"https://api.github.com/repos/indico/indico/deployments","created_at":"2011-07-27T13:56:30Z","updated_at":"2018-05-31T08:30:18Z","pushed_at":"2018-05-31T09:22:37Z","git_url":"git://github.com/indico/indico.git","ssh_url":"git@github.com:indico/indico.git","clone_url":"https://github.com/indico/indico.git","svn_url":"https://github.com/indico/indico","homepage":"https://getindico.io","size":204344,"stargazers_count":326,"watchers_count":326,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":129,"mirror_url":null,"archived":false,"open_issues_count":653,"license":{"key":"gpl-3.0","name":"GNU General Public License v3.0","spdx_id":"GPL-3.0","url":"https://api.github.com/licenses/gpl-3.0","node_id":"MDc6TGljZW5zZTk="},"forks":129,"open_issues":653,"watchers":326,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/indico/indico/pulls/3382"},"html":{"href":"https://github.com/indico/indico/pull/3382"},"issue":{"href":"https://api.github.com/repos/indico/indico/issues/3382"},"comments":{"href":"https://api.github.com/repos/indico/indico/issues/3382/comments"},"review_comments":{"href":"https://api.github.com/repos/indico/indico/pulls/3382/comments"},"review_comment":{"href":"https://api.github.com/repos/indico/indico/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/indico/indico/pulls/3382/commits"},"statuses":{"href":"https://api.github.com/repos/indico/indico/statuses/d4ccb6bc885a00e24715ad6fece964cb6e4339ca"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"pferreir"}}