{"action":"opened","number":1029,"pull_request":{"url":"https://api.github.com/repos/mozilla/pontoon/pulls/1029","id":204347993,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0MzQ3OTkz","html_url":"https://github.com/mozilla/pontoon/pull/1029","diff_url":"https://github.com/mozilla/pontoon/pull/1029.diff","patch_url":"https://github.com/mozilla/pontoon/pull/1029.patch","issue_url":"https://api.github.com/repos/mozilla/pontoon/issues/1029","number":1029,"state":"open","locked":false,"title":"Make sure related entities data is always prefetched","user":{"login":"mathjazz","id":626716,"node_id":"MDQ6VXNlcjYyNjcxNg==","avatar_url":"https://avatars2.githubusercontent.com/u/626716?v=4","gravatar_id":"","url":"https://api.github.com/users/mathjazz","html_url":"https://github.com/mathjazz","followers_url":"https://api.github.com/users/mathjazz/followers","following_url":"https://api.github.com/users/mathjazz/following{/other_user}","gists_url":"https://api.github.com/users/mathjazz/gists{/gist_id}","starred_url":"https://api.github.com/users/mathjazz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathjazz/subscriptions","organizations_url":"https://api.github.com/users/mathjazz/orgs","repos_url":"https://api.github.com/users/mathjazz/repos","events_url":"https://api.github.com/users/mathjazz/events{/privacy}","received_events_url":"https://api.github.com/users/mathjazz/received_events","type":"User","site_admin":false},"body":"Moving the `Prefetch` clause required for `map_entities` to `map_entities`, so that required data is always prefetched.\r\n\r\nFixes a bug which prevents string status from updating in the UI immediatelly after batch approval.\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"/usr/local/lib/python2.7/site-packages/django/core/handlers/exception.py\", line 41, in inner\r\n    response = get_response(request)\r\n  File \"/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py\", line 249, in _legacy_get_response\r\n    response = self._get_response(request)\r\n  File \"/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py\", line 187, in _get_response\r\n    response = self.process_exception_by_middleware(e, request)\r\n  File \"/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py\", line 185, in _get_response\r\n    response = wrapped_callback(request, *callback_args, **callback_kwargs)\r\n  File \"/usr/local/lib/python2.7/site-packages/django/views/decorators/csrf.py\", line 58, in wrapped_view\r\n    return view_func(*args, **kwargs)\r\n  File \"/usr/local/lib/python2.7/site-packages/django/views/decorators/http.py\", line 40, in inner\r\n    return func(request, *args, **kwargs)\r\n  File \"/app/pontoon/base/utils.py\", line 285, in wrap\r\n    return f(request, *args, **kwargs)\r\n  File \"/app/pontoon/base/views.py\", line 287, in entities\r\n    return _get_entities_list(locale, project, form)\r\n  File \"/app/pontoon/base/views.py\", line 201, in _get_entities_list\r\n    'entities': Entity.map_entities(locale, entities),\r\n  File \"/app/pontoon/base/models.py\", line 2314, in map_entities\r\n    'readonly': entity.resource.project.projectlocale[0].readonly,\r\nAttributeError: 'Project' object has no attribute 'projectlocale'\r\n```","created_at":"2018-07-27T07:13:27Z","updated_at":"2018-07-27T07:13:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/pontoon/pulls/1029/commits","review_comments_url":"https://api.github.com/repos/mozilla/pontoon/pulls/1029/comments","review_comment_url":"https://api.github.com/repos/mozilla/pontoon/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/pontoon/issues/1029/comments","statuses_url":"https://api.github.com/repos/mozilla/pontoon/statuses/d56963de273b15ddc5932d12fcef9157391d76cc","head":{"label":"mathjazz:no-bug-always-prefetch","ref":"no-bug-always-prefetch","sha":"d56963de273b15ddc5932d12fcef9157391d76cc","user":{"login":"mathjazz","id":626716,"node_id":"MDQ6VXNlcjYyNjcxNg==","avatar_url":"https://avatars2.githubusercontent.com/u/626716?v=4","gravatar_id":"","url":"https://api.github.com/users/mathjazz","html_url":"https://github.com/mathjazz","followers_url":"https://api.github.com/users/mathjazz/followers","following_url":"https://api.github.com/users/mathjazz/following{/other_user}","gists_url":"https://api.github.com/users/mathjazz/gists{/gist_id}","starred_url":"https://api.github.com/users/mathjazz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathjazz/subscriptions","organizations_url":"https://api.github.com/users/mathjazz/orgs","repos_url":"https://api.github.com/users/mathjazz/repos","events_url":"https://api.github.com/users/mathjazz/events{/privacy}","received_events_url":"https://api.github.com/users/mathjazz/received_events","type":"User","site_admin":false},"repo":{"id":35116849,"node_id":"MDEwOlJlcG9zaXRvcnkzNTExNjg0OQ==","name":"pontoon","full_name":"mathjazz/pontoon","owner":{"login":"mathjazz","id":626716,"node_id":"MDQ6VXNlcjYyNjcxNg==","avatar_url":"https://avatars2.githubusercontent.com/u/626716?v=4","gravatar_id":"","url":"https://api.github.com/users/mathjazz","html_url":"https://github.com/mathjazz","followers_url":"https://api.github.com/users/mathjazz/followers","following_url":"https://api.github.com/users/mathjazz/following{/other_user}","gists_url":"https://api.github.com/users/mathjazz/gists{/gist_id}","starred_url":"https://api.github.com/users/mathjazz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathjazz/subscriptions","organizations_url":"https://api.github.com/users/mathjazz/orgs","repos_url":"https://api.github.com/users/mathjazz/repos","events_url":"https://api.github.com/users/mathjazz/events{/privacy}","received_events_url":"https://api.github.com/users/mathjazz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mathjazz/pontoon","description":"In-place localization tool","fork":true,"url":"https://api.github.com/repos/mathjazz/pontoon","forks_url":"https://api.github.com/repos/mathjazz/pontoon/forks","keys_url":"https://api.github.com/repos/mathjazz/pontoon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mathjazz/pontoon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mathjazz/pontoon/teams","hooks_url":"https://api.github.com/repos/mathjazz/pontoon/hooks","issue_events_url":"https://api.github.com/repos/mathjazz/pontoon/issues/events{/number}","events_url":"https://api.github.com/repos/mathjazz/pontoon/events","assignees_url":"https://api.github.com/repos/mathjazz/pontoon/assignees{/user}","branches_url":"https://api.github.com/repos/mathjazz/pontoon/branches{/branch}","tags_url":"https://api.github.com/repos/mathjazz/pontoon/tags","blobs_url":"https://api.github.com/repos/mathjazz/pontoon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mathjazz/pontoon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mathjazz/pontoon/git/refs{/sha}","trees_url":"https://api.github.com/repos/mathjazz/pontoon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mathjazz/pontoon/statuses/{sha}","languages_url":"https://api.github.com/repos/mathjazz/pontoon/languages","stargazers_url":"https://api.github.com/repos/mathjazz/pontoon/stargazers","contributors_url":"https://api.github.com/repos/mathjazz/pontoon/contributors","subscribers_url":"https://api.github.com/repos/mathjazz/pontoon/subscribers","subscription_url":"https://api.github.com/repos/mathjazz/pontoon/subscription","commits_url":"https://api.github.com/repos/mathjazz/pontoon/commits{/sha}","git_commits_url":"https://api.github.com/repos/mathjazz/pontoon/git/commits{/sha}","comments_url":"https://api.github.com/repos/mathjazz/pontoon/comments{/number}","issue_comment_url":"https://api.github.com/repos/mathjazz/pontoon/issues/comments{/number}","contents_url":"https://api.github.com/repos/mathjazz/pontoon/contents/{+path}","compare_url":"https://api.github.com/repos/mathjazz/pontoon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mathjazz/pontoon/merges","archive_url":"https://api.github.com/repos/mathjazz/pontoon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mathjazz/pontoon/downloads","issues_url":"https://api.github.com/repos/mathjazz/pontoon/issues{/number}","pulls_url":"https://api.github.com/repos/mathjazz/pontoon/pulls{/number}","milestones_url":"https://api.github.com/repos/mathjazz/pontoon/milestones{/number}","notifications_url":"https://api.github.com/repos/mathjazz/pontoon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mathjazz/pontoon/labels{/name}","releases_url":"https://api.github.com/repos/mathjazz/pontoon/releases{/id}","deployments_url":"https://api.github.com/repos/mathjazz/pontoon/deployments","created_at":"2015-05-05T18:28:58Z","updated_at":"2018-07-26T16:53:00Z","pushed_at":"2018-07-27T07:06:16Z","git_url":"git://github.com/mathjazz/pontoon.git","ssh_url":"git@github.com:mathjazz/pontoon.git","clone_url":"https://github.com/mathjazz/pontoon.git","svn_url":"https://github.com/mathjazz/pontoon","homepage":"https://pontoon.mozilla.org/","size":24271,"stargazers_count":3,"watchers_count":3,"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":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":0,"watchers":3,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"df6b5ae7cae98f020077e626a35b4aa4b3e4b2c7","user":{"login":"mozilla","id":131524,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMTUyNA==","avatar_url":"https://avatars2.githubusercontent.com/u/131524?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":1385890,"node_id":"MDEwOlJlcG9zaXRvcnkxMzg1ODkw","name":"pontoon","full_name":"mozilla/pontoon","owner":{"login":"mozilla","id":131524,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEzMTUyNA==","avatar_url":"https://avatars2.githubusercontent.com/u/131524?v=4","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/pontoon","description":"Mozilla's Localization Platform","fork":false,"url":"https://api.github.com/repos/mozilla/pontoon","forks_url":"https://api.github.com/repos/mozilla/pontoon/forks","keys_url":"https://api.github.com/repos/mozilla/pontoon/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/pontoon/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/pontoon/teams","hooks_url":"https://api.github.com/repos/mozilla/pontoon/hooks","issue_events_url":"https://api.github.com/repos/mozilla/pontoon/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/pontoon/events","assignees_url":"https://api.github.com/repos/mozilla/pontoon/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/pontoon/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/pontoon/tags","blobs_url":"https://api.github.com/repos/mozilla/pontoon/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/pontoon/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/pontoon/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/pontoon/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/pontoon/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/pontoon/languages","stargazers_url":"https://api.github.com/repos/mozilla/pontoon/stargazers","contributors_url":"https://api.github.com/repos/mozilla/pontoon/contributors","subscribers_url":"https://api.github.com/repos/mozilla/pontoon/subscribers","subscription_url":"https://api.github.com/repos/mozilla/pontoon/subscription","commits_url":"https://api.github.com/repos/mozilla/pontoon/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/pontoon/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/pontoon/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/pontoon/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/pontoon/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/pontoon/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/pontoon/merges","archive_url":"https://api.github.com/repos/mozilla/pontoon/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/pontoon/downloads","issues_url":"https://api.github.com/repos/mozilla/pontoon/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/pontoon/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/pontoon/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/pontoon/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/pontoon/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/pontoon/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/pontoon/deployments","created_at":"2011-02-19T11:25:51Z","updated_at":"2018-07-26T16:44:20Z","pushed_at":"2018-07-26T16:44:18Z","git_url":"git://github.com/mozilla/pontoon.git","ssh_url":"git@github.com:mozilla/pontoon.git","clone_url":"https://github.com/mozilla/pontoon.git","svn_url":"https://github.com/mozilla/pontoon","homepage":"https://pontoon.mozilla.org/","size":24223,"stargazers_count":421,"watchers_count":421,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":120,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":120,"open_issues":5,"watchers":421,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/pontoon/pulls/1029"},"html":{"href":"https://github.com/mozilla/pontoon/pull/1029"},"issue":{"href":"https://api.github.com/repos/mozilla/pontoon/issues/1029"},"comments":{"href":"https://api.github.com/repos/mozilla/pontoon/issues/1029/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/pontoon/pulls/1029/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/pontoon/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/pontoon/pulls/1029/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/pontoon/statuses/d56963de273b15ddc5932d12fcef9157391d76cc"}},"author_association":"CONTRIBUTOR","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":10,"deletions":10,"changed_files":2}}
{"actor":{"display_login":"mathjazz"}}