{"action":"created","comment":{"url":"https://api.github.com/repos/django/django/pulls/comments/236040170","pull_request_review_id":178048526,"id":236040170,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjA0MDE3MA==","diff_hunk":"@@ -1929,6 +1929,9 @@ def _create_formsets(self, request, obj, change):\n         if change:\n             get_formsets_args.append(obj)\n         for FormSet, inline in self.get_formsets_with_inlines(*get_formsets_args):\n+            # Do not create inline for view-only user\n+            if not (inline._has_add_permission(request, obj) or inline.has_change_permission(request, obj)):\n+                continue","path":"django/contrib/admin/options.py","position":6,"original_position":6,"commit_id":"a263f66a2c894563d7ec906d90158c797db33d8e","original_commit_id":"a263f66a2c894563d7ec906d90158c797db33d8e","user":{"login":"matijakolaric","id":1566810,"node_id":"MDQ6VXNlcjE1NjY4MTA=","avatar_url":"https://avatars0.githubusercontent.com/u/1566810?v=4","gravatar_id":"","url":"https://api.github.com/users/matijakolaric","html_url":"https://github.com/matijakolaric","followers_url":"https://api.github.com/users/matijakolaric/followers","following_url":"https://api.github.com/users/matijakolaric/following{/other_user}","gists_url":"https://api.github.com/users/matijakolaric/gists{/gist_id}","starred_url":"https://api.github.com/users/matijakolaric/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matijakolaric/subscriptions","organizations_url":"https://api.github.com/users/matijakolaric/orgs","repos_url":"https://api.github.com/users/matijakolaric/repos","events_url":"https://api.github.com/users/matijakolaric/events{/privacy}","received_events_url":"https://api.github.com/users/matijakolaric/received_events","type":"User","site_admin":false},"body":"I tried a similar approach before opening a (duplicate) ticket, as well as one related to issues when POST fails. I ran into the error that forms have been messed with.\r\n\r\nIf POST fails, the output should be the same as in GET, with errors, of course. Everything else is a hack, IMHO. The only solution that seemed a good one to me is to deal with this at the point of validation, but that code is not in admin, so I concluded this was something for the core team.\r\n\r\n","created_at":"2018-11-24T11:48:18Z","updated_at":"2018-11-24T11:48:18Z","html_url":"https://github.com/django/django/pull/10678#discussion_r236040170","pull_request_url":"https://api.github.com/repos/django/django/pulls/10678","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/comments/236040170"},"html":{"href":"https://github.com/django/django/pull/10678#discussion_r236040170"},"pull_request":{"href":"https://api.github.com/repos/django/django/pulls/10678"}},"in_reply_to_id":235784704},"pull_request":{"url":"https://api.github.com/repos/django/django/pulls/10678","id":232930678,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMyOTMwNjc4","html_url":"https://github.com/django/django/pull/10678","diff_url":"https://github.com/django/django/pull/10678.diff","patch_url":"https://github.com/django/django/pull/10678.patch","issue_url":"https://api.github.com/repos/django/django/issues/10678","number":10678,"state":"open","locked":false,"title":"Fixed #29930 -- Allowed editing in admin with view-only inlines.","user":{"login":"carltongibson","id":64686,"node_id":"MDQ6VXNlcjY0Njg2","avatar_url":"https://avatars1.githubusercontent.com/u/64686?v=4","gravatar_id":"","url":"https://api.github.com/users/carltongibson","html_url":"https://github.com/carltongibson","followers_url":"https://api.github.com/users/carltongibson/followers","following_url":"https://api.github.com/users/carltongibson/following{/other_user}","gists_url":"https://api.github.com/users/carltongibson/gists{/gist_id}","starred_url":"https://api.github.com/users/carltongibson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carltongibson/subscriptions","organizations_url":"https://api.github.com/users/carltongibson/orgs","repos_url":"https://api.github.com/users/carltongibson/repos","events_url":"https://api.github.com/users/carltongibson/events{/privacy}","received_events_url":"https://api.github.com/users/carltongibson/received_events","type":"User","site_admin":false},"body":"* Uses test from patch provided by Tim Graham on ticket. \r\n* Skips inlines for view-only user in `_create_formsets()`\r\n\r\n**Don't merge yet**. this is not 100% right: I want to test that the read-only inline is shown in the right places. \r\n","created_at":"2018-11-22T10:35:34Z","updated_at":"2018-11-24T11:48:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c4c05bae08ccec0b90027e339d89444b3a6646d1","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/django/django/pulls/10678/commits","review_comments_url":"https://api.github.com/repos/django/django/pulls/10678/comments","review_comment_url":"https://api.github.com/repos/django/django/pulls/comments{/number}","comments_url":"https://api.github.com/repos/django/django/issues/10678/comments","statuses_url":"https://api.github.com/repos/django/django/statuses/a263f66a2c894563d7ec906d90158c797db33d8e","head":{"label":"carltongibson:issues/29969","ref":"issues/29969","sha":"a263f66a2c894563d7ec906d90158c797db33d8e","user":{"login":"carltongibson","id":64686,"node_id":"MDQ6VXNlcjY0Njg2","avatar_url":"https://avatars1.githubusercontent.com/u/64686?v=4","gravatar_id":"","url":"https://api.github.com/users/carltongibson","html_url":"https://github.com/carltongibson","followers_url":"https://api.github.com/users/carltongibson/followers","following_url":"https://api.github.com/users/carltongibson/following{/other_user}","gists_url":"https://api.github.com/users/carltongibson/gists{/gist_id}","starred_url":"https://api.github.com/users/carltongibson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carltongibson/subscriptions","organizations_url":"https://api.github.com/users/carltongibson/orgs","repos_url":"https://api.github.com/users/carltongibson/repos","events_url":"https://api.github.com/users/carltongibson/events{/privacy}","received_events_url":"https://api.github.com/users/carltongibson/received_events","type":"User","site_admin":false},"repo":{"id":80508391,"node_id":"MDEwOlJlcG9zaXRvcnk4MDUwODM5MQ==","name":"django","full_name":"carltongibson/django","private":false,"owner":{"login":"carltongibson","id":64686,"node_id":"MDQ6VXNlcjY0Njg2","avatar_url":"https://avatars1.githubusercontent.com/u/64686?v=4","gravatar_id":"","url":"https://api.github.com/users/carltongibson","html_url":"https://github.com/carltongibson","followers_url":"https://api.github.com/users/carltongibson/followers","following_url":"https://api.github.com/users/carltongibson/following{/other_user}","gists_url":"https://api.github.com/users/carltongibson/gists{/gist_id}","starred_url":"https://api.github.com/users/carltongibson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carltongibson/subscriptions","organizations_url":"https://api.github.com/users/carltongibson/orgs","repos_url":"https://api.github.com/users/carltongibson/repos","events_url":"https://api.github.com/users/carltongibson/events{/privacy}","received_events_url":"https://api.github.com/users/carltongibson/received_events","type":"User","site_admin":false},"html_url":"https://github.com/carltongibson/django","description":"The Web framework for perfectionists with deadlines.","fork":true,"url":"https://api.github.com/repos/carltongibson/django","forks_url":"https://api.github.com/repos/carltongibson/django/forks","keys_url":"https://api.github.com/repos/carltongibson/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/carltongibson/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/carltongibson/django/teams","hooks_url":"https://api.github.com/repos/carltongibson/django/hooks","issue_events_url":"https://api.github.com/repos/carltongibson/django/issues/events{/number}","events_url":"https://api.github.com/repos/carltongibson/django/events","assignees_url":"https://api.github.com/repos/carltongibson/django/assignees{/user}","branches_url":"https://api.github.com/repos/carltongibson/django/branches{/branch}","tags_url":"https://api.github.com/repos/carltongibson/django/tags","blobs_url":"https://api.github.com/repos/carltongibson/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/carltongibson/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/carltongibson/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/carltongibson/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/carltongibson/django/statuses/{sha}","languages_url":"https://api.github.com/repos/carltongibson/django/languages","stargazers_url":"https://api.github.com/repos/carltongibson/django/stargazers","contributors_url":"https://api.github.com/repos/carltongibson/django/contributors","subscribers_url":"https://api.github.com/repos/carltongibson/django/subscribers","subscription_url":"https://api.github.com/repos/carltongibson/django/subscription","commits_url":"https://api.github.com/repos/carltongibson/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/carltongibson/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/carltongibson/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/carltongibson/django/issues/comments{/number}","contents_url":"https://api.github.com/repos/carltongibson/django/contents/{+path}","compare_url":"https://api.github.com/repos/carltongibson/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/carltongibson/django/merges","archive_url":"https://api.github.com/repos/carltongibson/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/carltongibson/django/downloads","issues_url":"https://api.github.com/repos/carltongibson/django/issues{/number}","pulls_url":"https://api.github.com/repos/carltongibson/django/pulls{/number}","milestones_url":"https://api.github.com/repos/carltongibson/django/milestones{/number}","notifications_url":"https://api.github.com/repos/carltongibson/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/carltongibson/django/labels{/name}","releases_url":"https://api.github.com/repos/carltongibson/django/releases{/id}","deployments_url":"https://api.github.com/repos/carltongibson/django/deployments","created_at":"2017-01-31T09:51:50Z","updated_at":"2017-01-31T09:52:13Z","pushed_at":"2018-11-22T10:36:34Z","git_url":"git://github.com/carltongibson/django.git","ssh_url":"git@github.com:carltongibson/django.git","clone_url":"https://github.com/carltongibson/django.git","svn_url":"https://github.com/carltongibson/django","homepage":"https://www.djangoproject.com/","size":182343,"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":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"django:master","ref":"master","sha":"31408446b3880115a1f121230ce5e32e4e066a4b","user":{"login":"django","id":27804,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3ODA0","avatar_url":"https://avatars2.githubusercontent.com/u/27804?v=4","gravatar_id":"","url":"https://api.github.com/users/django","html_url":"https://github.com/django","followers_url":"https://api.github.com/users/django/followers","following_url":"https://api.github.com/users/django/following{/other_user}","gists_url":"https://api.github.com/users/django/gists{/gist_id}","starred_url":"https://api.github.com/users/django/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django/subscriptions","organizations_url":"https://api.github.com/users/django/orgs","repos_url":"https://api.github.com/users/django/repos","events_url":"https://api.github.com/users/django/events{/privacy}","received_events_url":"https://api.github.com/users/django/received_events","type":"Organization","site_admin":false},"repo":{"id":4164482,"node_id":"MDEwOlJlcG9zaXRvcnk0MTY0NDgy","name":"django","full_name":"django/django","private":false,"owner":{"login":"django","id":27804,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3ODA0","avatar_url":"https://avatars2.githubusercontent.com/u/27804?v=4","gravatar_id":"","url":"https://api.github.com/users/django","html_url":"https://github.com/django","followers_url":"https://api.github.com/users/django/followers","following_url":"https://api.github.com/users/django/following{/other_user}","gists_url":"https://api.github.com/users/django/gists{/gist_id}","starred_url":"https://api.github.com/users/django/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/django/subscriptions","organizations_url":"https://api.github.com/users/django/orgs","repos_url":"https://api.github.com/users/django/repos","events_url":"https://api.github.com/users/django/events{/privacy}","received_events_url":"https://api.github.com/users/django/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/django/django","description":"The Web framework for perfectionists with deadlines.","fork":false,"url":"https://api.github.com/repos/django/django","forks_url":"https://api.github.com/repos/django/django/forks","keys_url":"https://api.github.com/repos/django/django/keys{/key_id}","collaborators_url":"https://api.github.com/repos/django/django/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/django/django/teams","hooks_url":"https://api.github.com/repos/django/django/hooks","issue_events_url":"https://api.github.com/repos/django/django/issues/events{/number}","events_url":"https://api.github.com/repos/django/django/events","assignees_url":"https://api.github.com/repos/django/django/assignees{/user}","branches_url":"https://api.github.com/repos/django/django/branches{/branch}","tags_url":"https://api.github.com/repos/django/django/tags","blobs_url":"https://api.github.com/repos/django/django/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/django/django/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/django/django/git/refs{/sha}","trees_url":"https://api.github.com/repos/django/django/git/trees{/sha}","statuses_url":"https://api.github.com/repos/django/django/statuses/{sha}","languages_url":"https://api.github.com/repos/django/django/languages","stargazers_url":"https://api.github.com/repos/django/django/stargazers","contributors_url":"https://api.github.com/repos/django/django/contributors","subscribers_url":"https://api.github.com/repos/django/django/subscribers","subscription_url":"https://api.github.com/repos/django/django/subscription","commits_url":"https://api.github.com/repos/django/django/commits{/sha}","git_commits_url":"https://api.github.com/repos/django/django/git/commits{/sha}","comments_url":"https://api.github.com/repos/django/django/comments{/number}","issue_comment_url":"https://api.github.com/repos/django/django/issues/comments{/number}","contents_url":"https://api.github.com/repos/django/django/contents/{+path}","compare_url":"https://api.github.com/repos/django/django/compare/{base}...{head}","merges_url":"https://api.github.com/repos/django/django/merges","archive_url":"https://api.github.com/repos/django/django/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/django/django/downloads","issues_url":"https://api.github.com/repos/django/django/issues{/number}","pulls_url":"https://api.github.com/repos/django/django/pulls{/number}","milestones_url":"https://api.github.com/repos/django/django/milestones{/number}","notifications_url":"https://api.github.com/repos/django/django/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/django/django/labels{/name}","releases_url":"https://api.github.com/repos/django/django/releases{/id}","deployments_url":"https://api.github.com/repos/django/django/deployments","created_at":"2012-04-28T02:47:18Z","updated_at":"2018-11-24T11:21:35Z","pushed_at":"2018-11-24T11:29:55Z","git_url":"git://github.com/django/django.git","ssh_url":"git@github.com:django/django.git","clone_url":"https://github.com/django/django.git","svn_url":"https://github.com/django/django","homepage":"https://www.djangoproject.com/","size":183973,"stargazers_count":37807,"watchers_count":37807,"language":"Python","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":16322,"mirror_url":null,"archived":false,"open_issues_count":163,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":16322,"open_issues":163,"watchers":37807,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/django/django/pulls/10678"},"html":{"href":"https://github.com/django/django/pull/10678"},"issue":{"href":"https://api.github.com/repos/django/django/issues/10678"},"comments":{"href":"https://api.github.com/repos/django/django/issues/10678/comments"},"review_comments":{"href":"https://api.github.com/repos/django/django/pulls/10678/comments"},"review_comment":{"href":"https://api.github.com/repos/django/django/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/django/django/pulls/10678/commits"},"statuses":{"href":"https://api.github.com/repos/django/django/statuses/a263f66a2c894563d7ec906d90158c797db33d8e"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"matijakolaric"}}