{"action":"created","comment":{"url":"https://api.github.com/repos/getredash/redash/pulls/comments/168622309","pull_request_review_id":97022889,"id":168622309,"diff_hunk":"@@ -181,7 +181,10 @@ def get(self, token):\n         else:\n             dashboard = self.current_user.object\n \n-        return serializers.public_dashboard(dashboard)\n+        return project(\n+            dashboard.to_dict(with_widgets=True, user=self.current_user),\n+            ('name', 'layout', 'dashboard_filters_enabled', 'updated_at', 'created_at', 'widgets')","path":"redash/handlers/dashboards.py","position":16,"original_position":16,"commit_id":"b427fe90ef687f6c8f1dfaa5f43c636c68509297","original_commit_id":"b427fe90ef687f6c8f1dfaa5f43c636c68509297","user":{"login":"arikfr","id":71468,"avatar_url":"https://avatars2.githubusercontent.com/u/71468?v=4","gravatar_id":"","url":"https://api.github.com/users/arikfr","html_url":"https://github.com/arikfr","followers_url":"https://api.github.com/users/arikfr/followers","following_url":"https://api.github.com/users/arikfr/following{/other_user}","gists_url":"https://api.github.com/users/arikfr/gists{/gist_id}","starred_url":"https://api.github.com/users/arikfr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arikfr/subscriptions","organizations_url":"https://api.github.com/users/arikfr/orgs","repos_url":"https://api.github.com/users/arikfr/repos","events_url":"https://api.github.com/users/arikfr/events{/privacy}","received_events_url":"https://api.github.com/users/arikfr/received_events","type":"User","site_admin":false},"body":"How is it different when using `project`? The call to `project` will not be updated the same way the serializer wasn't updated. :-)\r\n\r\nSome context on serializers: the idea is to stop putting serialization logic in the models code (the `to_dict` methods). It's not a concern of the models and it makes code harder to write, as we can't assume state we usually have when we serialize data (like `current_user`).\r\n\r\nThe mistake here (aside from not having good UI tests that could've caught this) was to duplicate widgets layout logic in the public dashboards serializer. As you suggested we need to call the non public serializer (currently the `Dashboard#to_dict` method), and omit data from the returned object (along with adding the query result). But we need to do it in the serializer.","created_at":"2018-02-15T22:03:08Z","updated_at":"2018-02-15T22:03:08Z","html_url":"https://github.com/getredash/redash/pull/2320#discussion_r168622309","pull_request_url":"https://api.github.com/repos/getredash/redash/pulls/2320","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/getredash/redash/pulls/comments/168622309"},"html":{"href":"https://github.com/getredash/redash/pull/2320#discussion_r168622309"},"pull_request":{"href":"https://api.github.com/repos/getredash/redash/pulls/2320"}},"in_reply_to_id":168606211},"pull_request":{"url":"https://api.github.com/repos/getredash/redash/pulls/2320","id":169482429,"html_url":"https://github.com/getredash/redash/pull/2320","diff_url":"https://github.com/getredash/redash/pull/2320.diff","patch_url":"https://github.com/getredash/redash/pull/2320.patch","issue_url":"https://api.github.com/repos/getredash/redash/issues/2320","number":2320,"state":"open","locked":false,"title":"Few bugfixes","user":{"login":"kravets-levko","id":12139186,"avatar_url":"https://avatars3.githubusercontent.com/u/12139186?v=4","gravatar_id":"","url":"https://api.github.com/users/kravets-levko","html_url":"https://github.com/kravets-levko","followers_url":"https://api.github.com/users/kravets-levko/followers","following_url":"https://api.github.com/users/kravets-levko/following{/other_user}","gists_url":"https://api.github.com/users/kravets-levko/gists{/gist_id}","starred_url":"https://api.github.com/users/kravets-levko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kravets-levko/subscriptions","organizations_url":"https://api.github.com/users/kravets-levko/orgs","repos_url":"https://api.github.com/users/kravets-levko/repos","events_url":"https://api.github.com/users/kravets-levko/events{/privacy}","received_events_url":"https://api.github.com/users/kravets-levko/received_events","type":"User","site_admin":false},"body":"1. https://discuss.redash.io/t/v4-beta-public-sharing-blank/1533\r\n2. After generating \"Invite user\" link and \"Reset password\" link, UI showed relative link (only path fragment), and UI was inconsistent (one of them was shown in textarea and another - as link). Now it looks like this:\r\n\r\n![image](https://user-images.githubusercontent.com/12139186/36280446-f96092d8-12a2-11e8-8728-ae1e60cea017.png)\r\n![image](https://user-images.githubusercontent.com/12139186/36280492-17898120-12a3-11e8-9209-51f5737f1724.png)\r\n","created_at":"2018-02-15T20:54:20Z","updated_at":"2018-02-15T22:03:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"edda7992784aed19401b36c6e604c2ea12c01a64","assignee":{"login":"arikfr","id":71468,"avatar_url":"https://avatars2.githubusercontent.com/u/71468?v=4","gravatar_id":"","url":"https://api.github.com/users/arikfr","html_url":"https://github.com/arikfr","followers_url":"https://api.github.com/users/arikfr/followers","following_url":"https://api.github.com/users/arikfr/following{/other_user}","gists_url":"https://api.github.com/users/arikfr/gists{/gist_id}","starred_url":"https://api.github.com/users/arikfr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arikfr/subscriptions","organizations_url":"https://api.github.com/users/arikfr/orgs","repos_url":"https://api.github.com/users/arikfr/repos","events_url":"https://api.github.com/users/arikfr/events{/privacy}","received_events_url":"https://api.github.com/users/arikfr/received_events","type":"User","site_admin":false},"assignees":[{"login":"arikfr","id":71468,"avatar_url":"https://avatars2.githubusercontent.com/u/71468?v=4","gravatar_id":"","url":"https://api.github.com/users/arikfr","html_url":"https://github.com/arikfr","followers_url":"https://api.github.com/users/arikfr/followers","following_url":"https://api.github.com/users/arikfr/following{/other_user}","gists_url":"https://api.github.com/users/arikfr/gists{/gist_id}","starred_url":"https://api.github.com/users/arikfr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arikfr/subscriptions","organizations_url":"https://api.github.com/users/arikfr/orgs","repos_url":"https://api.github.com/users/arikfr/repos","events_url":"https://api.github.com/users/arikfr/events{/privacy}","received_events_url":"https://api.github.com/users/arikfr/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"kocsmy","id":2378022,"avatar_url":"https://avatars2.githubusercontent.com/u/2378022?v=4","gravatar_id":"","url":"https://api.github.com/users/kocsmy","html_url":"https://github.com/kocsmy","followers_url":"https://api.github.com/users/kocsmy/followers","following_url":"https://api.github.com/users/kocsmy/following{/other_user}","gists_url":"https://api.github.com/users/kocsmy/gists{/gist_id}","starred_url":"https://api.github.com/users/kocsmy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kocsmy/subscriptions","organizations_url":"https://api.github.com/users/kocsmy/orgs","repos_url":"https://api.github.com/users/kocsmy/repos","events_url":"https://api.github.com/users/kocsmy/events{/privacy}","received_events_url":"https://api.github.com/users/kocsmy/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/getredash/redash/pulls/2320/commits","review_comments_url":"https://api.github.com/repos/getredash/redash/pulls/2320/comments","review_comment_url":"https://api.github.com/repos/getredash/redash/pulls/comments{/number}","comments_url":"https://api.github.com/repos/getredash/redash/issues/2320/comments","statuses_url":"https://api.github.com/repos/getredash/redash/statuses/b427fe90ef687f6c8f1dfaa5f43c636c68509297","head":{"label":"kravets-levko:bug/few-bugfixes","ref":"bug/few-bugfixes","sha":"b427fe90ef687f6c8f1dfaa5f43c636c68509297","user":{"login":"kravets-levko","id":12139186,"avatar_url":"https://avatars3.githubusercontent.com/u/12139186?v=4","gravatar_id":"","url":"https://api.github.com/users/kravets-levko","html_url":"https://github.com/kravets-levko","followers_url":"https://api.github.com/users/kravets-levko/followers","following_url":"https://api.github.com/users/kravets-levko/following{/other_user}","gists_url":"https://api.github.com/users/kravets-levko/gists{/gist_id}","starred_url":"https://api.github.com/users/kravets-levko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kravets-levko/subscriptions","organizations_url":"https://api.github.com/users/kravets-levko/orgs","repos_url":"https://api.github.com/users/kravets-levko/repos","events_url":"https://api.github.com/users/kravets-levko/events{/privacy}","received_events_url":"https://api.github.com/users/kravets-levko/received_events","type":"User","site_admin":false},"repo":{"id":105663177,"name":"redash","full_name":"kravets-levko/redash","owner":{"login":"kravets-levko","id":12139186,"avatar_url":"https://avatars3.githubusercontent.com/u/12139186?v=4","gravatar_id":"","url":"https://api.github.com/users/kravets-levko","html_url":"https://github.com/kravets-levko","followers_url":"https://api.github.com/users/kravets-levko/followers","following_url":"https://api.github.com/users/kravets-levko/following{/other_user}","gists_url":"https://api.github.com/users/kravets-levko/gists{/gist_id}","starred_url":"https://api.github.com/users/kravets-levko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kravets-levko/subscriptions","organizations_url":"https://api.github.com/users/kravets-levko/orgs","repos_url":"https://api.github.com/users/kravets-levko/repos","events_url":"https://api.github.com/users/kravets-levko/events{/privacy}","received_events_url":"https://api.github.com/users/kravets-levko/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kravets-levko/redash","description":"Make Your Company Data Driven. Connect to any data source, easily visualize and share your data.","fork":true,"url":"https://api.github.com/repos/kravets-levko/redash","forks_url":"https://api.github.com/repos/kravets-levko/redash/forks","keys_url":"https://api.github.com/repos/kravets-levko/redash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kravets-levko/redash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kravets-levko/redash/teams","hooks_url":"https://api.github.com/repos/kravets-levko/redash/hooks","issue_events_url":"https://api.github.com/repos/kravets-levko/redash/issues/events{/number}","events_url":"https://api.github.com/repos/kravets-levko/redash/events","assignees_url":"https://api.github.com/repos/kravets-levko/redash/assignees{/user}","branches_url":"https://api.github.com/repos/kravets-levko/redash/branches{/branch}","tags_url":"https://api.github.com/repos/kravets-levko/redash/tags","blobs_url":"https://api.github.com/repos/kravets-levko/redash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kravets-levko/redash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kravets-levko/redash/git/refs{/sha}","trees_url":"https://api.github.com/repos/kravets-levko/redash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kravets-levko/redash/statuses/{sha}","languages_url":"https://api.github.com/repos/kravets-levko/redash/languages","stargazers_url":"https://api.github.com/repos/kravets-levko/redash/stargazers","contributors_url":"https://api.github.com/repos/kravets-levko/redash/contributors","subscribers_url":"https://api.github.com/repos/kravets-levko/redash/subscribers","subscription_url":"https://api.github.com/repos/kravets-levko/redash/subscription","commits_url":"https://api.github.com/repos/kravets-levko/redash/commits{/sha}","git_commits_url":"https://api.github.com/repos/kravets-levko/redash/git/commits{/sha}","comments_url":"https://api.github.com/repos/kravets-levko/redash/comments{/number}","issue_comment_url":"https://api.github.com/repos/kravets-levko/redash/issues/comments{/number}","contents_url":"https://api.github.com/repos/kravets-levko/redash/contents/{+path}","compare_url":"https://api.github.com/repos/kravets-levko/redash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kravets-levko/redash/merges","archive_url":"https://api.github.com/repos/kravets-levko/redash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kravets-levko/redash/downloads","issues_url":"https://api.github.com/repos/kravets-levko/redash/issues{/number}","pulls_url":"https://api.github.com/repos/kravets-levko/redash/pulls{/number}","milestones_url":"https://api.github.com/repos/kravets-levko/redash/milestones{/number}","notifications_url":"https://api.github.com/repos/kravets-levko/redash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kravets-levko/redash/labels{/name}","releases_url":"https://api.github.com/repos/kravets-levko/redash/releases{/id}","deployments_url":"https://api.github.com/repos/kravets-levko/redash/deployments","created_at":"2017-10-03T14:42:17Z","updated_at":"2017-10-03T14:42:22Z","pushed_at":"2018-02-15T20:50:26Z","git_url":"git://github.com/kravets-levko/redash.git","ssh_url":"git@github.com:kravets-levko/redash.git","clone_url":"https://github.com/kravets-levko/redash.git","svn_url":"https://github.com/kravets-levko/redash","homepage":"http://redash.io/","size":10144,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"bsd-2-clause","name":"BSD 2-Clause \"Simplified\" License","spdx_id":"BSD-2-Clause","url":"https://api.github.com/licenses/bsd-2-clause"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"getredash:master","ref":"master","sha":"927599cf00bdddfb0f1b5e5b3d270c65ccf1c1ed","user":{"login":"getredash","id":10746780,"avatar_url":"https://avatars2.githubusercontent.com/u/10746780?v=4","gravatar_id":"","url":"https://api.github.com/users/getredash","html_url":"https://github.com/getredash","followers_url":"https://api.github.com/users/getredash/followers","following_url":"https://api.github.com/users/getredash/following{/other_user}","gists_url":"https://api.github.com/users/getredash/gists{/gist_id}","starred_url":"https://api.github.com/users/getredash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getredash/subscriptions","organizations_url":"https://api.github.com/users/getredash/orgs","repos_url":"https://api.github.com/users/getredash/repos","events_url":"https://api.github.com/users/getredash/events{/privacy}","received_events_url":"https://api.github.com/users/getredash/received_events","type":"Organization","site_admin":false},"repo":{"id":13926404,"name":"redash","full_name":"getredash/redash","owner":{"login":"getredash","id":10746780,"avatar_url":"https://avatars2.githubusercontent.com/u/10746780?v=4","gravatar_id":"","url":"https://api.github.com/users/getredash","html_url":"https://github.com/getredash","followers_url":"https://api.github.com/users/getredash/followers","following_url":"https://api.github.com/users/getredash/following{/other_user}","gists_url":"https://api.github.com/users/getredash/gists{/gist_id}","starred_url":"https://api.github.com/users/getredash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/getredash/subscriptions","organizations_url":"https://api.github.com/users/getredash/orgs","repos_url":"https://api.github.com/users/getredash/repos","events_url":"https://api.github.com/users/getredash/events{/privacy}","received_events_url":"https://api.github.com/users/getredash/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/getredash/redash","description":"Make Your Company Data Driven. Connect to any data source, easily visualize and share your data.","fork":false,"url":"https://api.github.com/repos/getredash/redash","forks_url":"https://api.github.com/repos/getredash/redash/forks","keys_url":"https://api.github.com/repos/getredash/redash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/getredash/redash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/getredash/redash/teams","hooks_url":"https://api.github.com/repos/getredash/redash/hooks","issue_events_url":"https://api.github.com/repos/getredash/redash/issues/events{/number}","events_url":"https://api.github.com/repos/getredash/redash/events","assignees_url":"https://api.github.com/repos/getredash/redash/assignees{/user}","branches_url":"https://api.github.com/repos/getredash/redash/branches{/branch}","tags_url":"https://api.github.com/repos/getredash/redash/tags","blobs_url":"https://api.github.com/repos/getredash/redash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/getredash/redash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/getredash/redash/git/refs{/sha}","trees_url":"https://api.github.com/repos/getredash/redash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/getredash/redash/statuses/{sha}","languages_url":"https://api.github.com/repos/getredash/redash/languages","stargazers_url":"https://api.github.com/repos/getredash/redash/stargazers","contributors_url":"https://api.github.com/repos/getredash/redash/contributors","subscribers_url":"https://api.github.com/repos/getredash/redash/subscribers","subscription_url":"https://api.github.com/repos/getredash/redash/subscription","commits_url":"https://api.github.com/repos/getredash/redash/commits{/sha}","git_commits_url":"https://api.github.com/repos/getredash/redash/git/commits{/sha}","comments_url":"https://api.github.com/repos/getredash/redash/comments{/number}","issue_comment_url":"https://api.github.com/repos/getredash/redash/issues/comments{/number}","contents_url":"https://api.github.com/repos/getredash/redash/contents/{+path}","compare_url":"https://api.github.com/repos/getredash/redash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/getredash/redash/merges","archive_url":"https://api.github.com/repos/getredash/redash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/getredash/redash/downloads","issues_url":"https://api.github.com/repos/getredash/redash/issues{/number}","pulls_url":"https://api.github.com/repos/getredash/redash/pulls{/number}","milestones_url":"https://api.github.com/repos/getredash/redash/milestones{/number}","notifications_url":"https://api.github.com/repos/getredash/redash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/getredash/redash/labels{/name}","releases_url":"https://api.github.com/repos/getredash/redash/releases{/id}","deployments_url":"https://api.github.com/repos/getredash/redash/deployments","created_at":"2013-10-28T13:19:39Z","updated_at":"2018-02-15T15:41:45Z","pushed_at":"2018-02-15T20:54:21Z","git_url":"git://github.com/getredash/redash.git","ssh_url":"git@github.com:getredash/redash.git","clone_url":"https://github.com/getredash/redash.git","svn_url":"https://github.com/getredash/redash","homepage":"http://redash.io/","size":9735,"stargazers_count":8444,"watchers_count":8444,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":1274,"mirror_url":null,"archived":false,"open_issues_count":261,"license":{"key":"bsd-2-clause","name":"BSD 2-Clause \"Simplified\" License","spdx_id":"BSD-2-Clause","url":"https://api.github.com/licenses/bsd-2-clause"},"forks":1274,"open_issues":261,"watchers":8444,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/getredash/redash/pulls/2320"},"html":{"href":"https://github.com/getredash/redash/pull/2320"},"issue":{"href":"https://api.github.com/repos/getredash/redash/issues/2320"},"comments":{"href":"https://api.github.com/repos/getredash/redash/issues/2320/comments"},"review_comments":{"href":"https://api.github.com/repos/getredash/redash/pulls/2320/comments"},"review_comment":{"href":"https://api.github.com/repos/getredash/redash/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/getredash/redash/pulls/2320/commits"},"statuses":{"href":"https://api.github.com/repos/getredash/redash/statuses/b427fe90ef687f6c8f1dfaa5f43c636c68509297"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"arikfr"}}