{"action":"closed","number":464,"pull_request":{"url":"https://api.github.com/repos/ansible/awx/pulls/464","id":147308589,"html_url":"https://github.com/ansible/awx/pull/464","diff_url":"https://github.com/ansible/awx/pull/464.diff","patch_url":"https://github.com/ansible/awx/pull/464.patch","issue_url":"https://api.github.com/repos/ansible/awx/issues/464","number":464,"state":"closed","locked":false,"title":"fix bug where JT admins could not edit spec","user":{"login":"AlanCoding","id":1385596,"avatar_url":"https://avatars3.githubusercontent.com/u/1385596?v=4","gravatar_id":"","url":"https://api.github.com/users/AlanCoding","html_url":"https://github.com/AlanCoding","followers_url":"https://api.github.com/users/AlanCoding/followers","following_url":"https://api.github.com/users/AlanCoding/following{/other_user}","gists_url":"https://api.github.com/users/AlanCoding/gists{/gist_id}","starred_url":"https://api.github.com/users/AlanCoding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlanCoding/subscriptions","organizations_url":"https://api.github.com/users/AlanCoding/orgs","repos_url":"https://api.github.com/users/AlanCoding/repos","events_url":"https://api.github.com/users/AlanCoding/events{/privacy}","received_events_url":"https://api.github.com/users/AlanCoding/received_events","type":"User","site_admin":false},"body":"Connect #388\r\n\r\n### General Design\r\n\r\nWe have a number of views that apply to an object, but is not the edit view for that object.\r\n\r\nThis gets tremendously confusing when you get into the permissions check, and we have had these flags like `is_job_start`, which would tell the permission class \"oh, I should check start permission\".\r\n\r\nI wanted to generalize this a little bit, so that editing the survey spec is still kind of congruent with these special-actions of launching, canceling, etc.\r\n\r\nRequesting review from @jangsutsr because it'll have tie-ins to copy permission checking.\r\n\r\n### Test exception message\r\n\r\nI added extra code to conftest, in order to change this type of message:\r\n\r\n```\r\n (awx) [root@awx awx_devel]# py.test awx/main/tests/functional/api/test_survey_spec.py::test_survey_edit_access\r\n ============================================================================= test session starts =============================================================================\r\n platform linux2 -- Python 2.7.5, pytest-2.9.2, py-1.4.34, pluggy-0.3.1\r\n Django settings: awx.settings.development (from ini file)\r\n rootdir: /awx_devel, inifile: pytest.ini\r\n plugins: pythonpath-0.7.1, mock-1.6.3, django-3.1.2, cov-2.5.1\r\n collected 22 items \r\n\r\n awx/main/tests/functional/api/test_survey_spec.py F..\r\n\r\n ================================================================================== FAILURES ===================================================================================\r\n ___________________________________________________________________ test_survey_edit_access[admin_role-200] ___________________________________________________________________\r\n Traceback (most recent call last):\r\n   File \"/awx_devel/awx/main/tests/functional/api/test_survey_spec.py\", line 50, in test_survey_edit_access\r\n     user=rando, expect=expected_status_code)\r\n   File \"/awx_devel/awx/main/tests/functional/conftest.py\", line 545, in rf\r\n     assert response.status_code == expect\r\n AssertionError: assert 400 == 200\r\n  +  where 400 = 400\r\n  +    where 400 = <rest_framework.response.Response object at 0x7680d10>.status_code\r\n ---------------------------------------------------------------------------- Captured stdout call -----------------------------------------------------------------------------\r\n {'error': <django.utils.functional.__proxy__ object at 0x7684e50>}\r\n ===================================================================== 1 failed, 2 passed in 1.35 seconds ======================================================================\r\n```\r\n\r\nto have the actual error message, see that `django.utils.functional.__proxy__` changed to an error\r\n\r\n```\r\n (awx) [root@awx awx_devel]# py.test awx/main/tests/functional/api/test_survey_spec.py::test_survey_edit_access\r\n ============================================================================= test session starts =============================================================================\r\n platform linux2 -- Python 2.7.5, pytest-2.9.2, py-1.4.34, pluggy-0.3.1\r\n Django settings: awx.settings.development (from ini file)\r\n rootdir: /awx_devel, inifile: pytest.ini\r\n plugins: pythonpath-0.7.1, mock-1.6.3, django-3.1.2, cov-2.5.1\r\n collected 22 items \r\n\r\n awx/main/tests/functional/api/test_survey_spec.py F..\r\n\r\n ================================================================================== FAILURES ===================================================================================\r\n ___________________________________________________________________ test_survey_edit_access[admin_role-200] ___________________________________________________________________\r\n Traceback (most recent call last):\r\n   File \"/awx_devel/awx/main/tests/functional/api/test_survey_spec.py\", line 50, in test_survey_edit_access\r\n     user=rando, expect=expected_status_code)\r\n   File \"/awx_devel/awx/main/tests/functional/conftest.py\", line 544, in rf\r\n     assert response.status_code == expect\r\n AssertionError: assert 400 == 200\r\n  +  where 400 = 400\r\n  +    where 400 = <rest_framework.response.Response object at 0x731fd10>.status_code\r\n ---------------------------------------------------------------------------- Captured stdout call -----------------------------------------------------------------------------\r\n {'error': \"'name' missing from survey spec.\"}\r\n ===================================================================== 1 failed, 2 passed in 1.37 seconds ======================================================================\r\n```","created_at":"2017-10-18T13:58:54Z","updated_at":"2017-10-19T20:22:15Z","closed_at":"2017-10-19T20:22:15Z","merged_at":"2017-10-19T20:22:15Z","merge_commit_sha":"083e56d97df4b0810b9f1ad63040b6b586343c09","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jangsutsr","id":14990293,"avatar_url":"https://avatars1.githubusercontent.com/u/14990293?v=4","gravatar_id":"","url":"https://api.github.com/users/jangsutsr","html_url":"https://github.com/jangsutsr","followers_url":"https://api.github.com/users/jangsutsr/followers","following_url":"https://api.github.com/users/jangsutsr/following{/other_user}","gists_url":"https://api.github.com/users/jangsutsr/gists{/gist_id}","starred_url":"https://api.github.com/users/jangsutsr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jangsutsr/subscriptions","organizations_url":"https://api.github.com/users/jangsutsr/orgs","repos_url":"https://api.github.com/users/jangsutsr/repos","events_url":"https://api.github.com/users/jangsutsr/events{/privacy}","received_events_url":"https://api.github.com/users/jangsutsr/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ansible/awx/pulls/464/commits","review_comments_url":"https://api.github.com/repos/ansible/awx/pulls/464/comments","review_comment_url":"https://api.github.com/repos/ansible/awx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ansible/awx/issues/464/comments","statuses_url":"https://api.github.com/repos/ansible/awx/statuses/098a407e257e3c7b775d7f26d357d966281e0c8c","head":{"label":"AlanCoding:actiony_permissions","ref":"actiony_permissions","sha":"098a407e257e3c7b775d7f26d357d966281e0c8c","user":{"login":"AlanCoding","id":1385596,"avatar_url":"https://avatars3.githubusercontent.com/u/1385596?v=4","gravatar_id":"","url":"https://api.github.com/users/AlanCoding","html_url":"https://github.com/AlanCoding","followers_url":"https://api.github.com/users/AlanCoding/followers","following_url":"https://api.github.com/users/AlanCoding/following{/other_user}","gists_url":"https://api.github.com/users/AlanCoding/gists{/gist_id}","starred_url":"https://api.github.com/users/AlanCoding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlanCoding/subscriptions","organizations_url":"https://api.github.com/users/AlanCoding/orgs","repos_url":"https://api.github.com/users/AlanCoding/repos","events_url":"https://api.github.com/users/AlanCoding/events{/privacy}","received_events_url":"https://api.github.com/users/AlanCoding/received_events","type":"User","site_admin":false},"repo":{"id":102798838,"name":"awx-1","full_name":"AlanCoding/awx-1","owner":{"login":"AlanCoding","id":1385596,"avatar_url":"https://avatars3.githubusercontent.com/u/1385596?v=4","gravatar_id":"","url":"https://api.github.com/users/AlanCoding","html_url":"https://github.com/AlanCoding","followers_url":"https://api.github.com/users/AlanCoding/followers","following_url":"https://api.github.com/users/AlanCoding/following{/other_user}","gists_url":"https://api.github.com/users/AlanCoding/gists{/gist_id}","starred_url":"https://api.github.com/users/AlanCoding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlanCoding/subscriptions","organizations_url":"https://api.github.com/users/AlanCoding/orgs","repos_url":"https://api.github.com/users/AlanCoding/repos","events_url":"https://api.github.com/users/AlanCoding/events{/privacy}","received_events_url":"https://api.github.com/users/AlanCoding/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/AlanCoding/awx-1","description":"AWX Project","fork":true,"url":"https://api.github.com/repos/AlanCoding/awx-1","forks_url":"https://api.github.com/repos/AlanCoding/awx-1/forks","keys_url":"https://api.github.com/repos/AlanCoding/awx-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AlanCoding/awx-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AlanCoding/awx-1/teams","hooks_url":"https://api.github.com/repos/AlanCoding/awx-1/hooks","issue_events_url":"https://api.github.com/repos/AlanCoding/awx-1/issues/events{/number}","events_url":"https://api.github.com/repos/AlanCoding/awx-1/events","assignees_url":"https://api.github.com/repos/AlanCoding/awx-1/assignees{/user}","branches_url":"https://api.github.com/repos/AlanCoding/awx-1/branches{/branch}","tags_url":"https://api.github.com/repos/AlanCoding/awx-1/tags","blobs_url":"https://api.github.com/repos/AlanCoding/awx-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AlanCoding/awx-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AlanCoding/awx-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/AlanCoding/awx-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AlanCoding/awx-1/statuses/{sha}","languages_url":"https://api.github.com/repos/AlanCoding/awx-1/languages","stargazers_url":"https://api.github.com/repos/AlanCoding/awx-1/stargazers","contributors_url":"https://api.github.com/repos/AlanCoding/awx-1/contributors","subscribers_url":"https://api.github.com/repos/AlanCoding/awx-1/subscribers","subscription_url":"https://api.github.com/repos/AlanCoding/awx-1/subscription","commits_url":"https://api.github.com/repos/AlanCoding/awx-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/AlanCoding/awx-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/AlanCoding/awx-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/AlanCoding/awx-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/AlanCoding/awx-1/contents/{+path}","compare_url":"https://api.github.com/repos/AlanCoding/awx-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AlanCoding/awx-1/merges","archive_url":"https://api.github.com/repos/AlanCoding/awx-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AlanCoding/awx-1/downloads","issues_url":"https://api.github.com/repos/AlanCoding/awx-1/issues{/number}","pulls_url":"https://api.github.com/repos/AlanCoding/awx-1/pulls{/number}","milestones_url":"https://api.github.com/repos/AlanCoding/awx-1/milestones{/number}","notifications_url":"https://api.github.com/repos/AlanCoding/awx-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AlanCoding/awx-1/labels{/name}","releases_url":"https://api.github.com/repos/AlanCoding/awx-1/releases{/id}","deployments_url":"https://api.github.com/repos/AlanCoding/awx-1/deployments","created_at":"2017-09-08T00:27:27Z","updated_at":"2017-09-08T00:27:32Z","pushed_at":"2017-10-19T20:17:21Z","git_url":"git://github.com/AlanCoding/awx-1.git","ssh_url":"git@github.com:AlanCoding/awx-1.git","clone_url":"https://github.com/AlanCoding/awx-1.git","svn_url":"https://github.com/AlanCoding/awx-1","homepage":"","size":191270,"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,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"devel"}},"base":{"label":"ansible:devel","ref":"devel","sha":"6347db56c5f0c587cc80bd3d0ec9f9c1343fefd6","user":{"login":"ansible","id":1507452,"avatar_url":"https://avatars2.githubusercontent.com/u/1507452?v=4","gravatar_id":"","url":"https://api.github.com/users/ansible","html_url":"https://github.com/ansible","followers_url":"https://api.github.com/users/ansible/followers","following_url":"https://api.github.com/users/ansible/following{/other_user}","gists_url":"https://api.github.com/users/ansible/gists{/gist_id}","starred_url":"https://api.github.com/users/ansible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansible/subscriptions","organizations_url":"https://api.github.com/users/ansible/orgs","repos_url":"https://api.github.com/users/ansible/repos","events_url":"https://api.github.com/users/ansible/events{/privacy}","received_events_url":"https://api.github.com/users/ansible/received_events","type":"Organization","site_admin":false},"repo":{"id":91594105,"name":"awx","full_name":"ansible/awx","owner":{"login":"ansible","id":1507452,"avatar_url":"https://avatars2.githubusercontent.com/u/1507452?v=4","gravatar_id":"","url":"https://api.github.com/users/ansible","html_url":"https://github.com/ansible","followers_url":"https://api.github.com/users/ansible/followers","following_url":"https://api.github.com/users/ansible/following{/other_user}","gists_url":"https://api.github.com/users/ansible/gists{/gist_id}","starred_url":"https://api.github.com/users/ansible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ansible/subscriptions","organizations_url":"https://api.github.com/users/ansible/orgs","repos_url":"https://api.github.com/users/ansible/repos","events_url":"https://api.github.com/users/ansible/events{/privacy}","received_events_url":"https://api.github.com/users/ansible/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ansible/awx","description":"AWX Project","fork":false,"url":"https://api.github.com/repos/ansible/awx","forks_url":"https://api.github.com/repos/ansible/awx/forks","keys_url":"https://api.github.com/repos/ansible/awx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ansible/awx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ansible/awx/teams","hooks_url":"https://api.github.com/repos/ansible/awx/hooks","issue_events_url":"https://api.github.com/repos/ansible/awx/issues/events{/number}","events_url":"https://api.github.com/repos/ansible/awx/events","assignees_url":"https://api.github.com/repos/ansible/awx/assignees{/user}","branches_url":"https://api.github.com/repos/ansible/awx/branches{/branch}","tags_url":"https://api.github.com/repos/ansible/awx/tags","blobs_url":"https://api.github.com/repos/ansible/awx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ansible/awx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ansible/awx/git/refs{/sha}","trees_url":"https://api.github.com/repos/ansible/awx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ansible/awx/statuses/{sha}","languages_url":"https://api.github.com/repos/ansible/awx/languages","stargazers_url":"https://api.github.com/repos/ansible/awx/stargazers","contributors_url":"https://api.github.com/repos/ansible/awx/contributors","subscribers_url":"https://api.github.com/repos/ansible/awx/subscribers","subscription_url":"https://api.github.com/repos/ansible/awx/subscription","commits_url":"https://api.github.com/repos/ansible/awx/commits{/sha}","git_commits_url":"https://api.github.com/repos/ansible/awx/git/commits{/sha}","comments_url":"https://api.github.com/repos/ansible/awx/comments{/number}","issue_comment_url":"https://api.github.com/repos/ansible/awx/issues/comments{/number}","contents_url":"https://api.github.com/repos/ansible/awx/contents/{+path}","compare_url":"https://api.github.com/repos/ansible/awx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ansible/awx/merges","archive_url":"https://api.github.com/repos/ansible/awx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ansible/awx/downloads","issues_url":"https://api.github.com/repos/ansible/awx/issues{/number}","pulls_url":"https://api.github.com/repos/ansible/awx/pulls{/number}","milestones_url":"https://api.github.com/repos/ansible/awx/milestones{/number}","notifications_url":"https://api.github.com/repos/ansible/awx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ansible/awx/labels{/name}","releases_url":"https://api.github.com/repos/ansible/awx/releases{/id}","deployments_url":"https://api.github.com/repos/ansible/awx/deployments","created_at":"2017-05-17T15:50:14Z","updated_at":"2017-10-19T19:18:42Z","pushed_at":"2017-10-19T20:22:15Z","git_url":"git://github.com/ansible/awx.git","ssh_url":"git@github.com:ansible/awx.git","clone_url":"https://github.com/ansible/awx.git","svn_url":"https://github.com/ansible/awx","homepage":"","size":191227,"stargazers_count":2552,"watchers_count":2552,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":276,"mirror_url":null,"open_issues_count":153,"forks":276,"open_issues":153,"watchers":2552,"default_branch":"devel"}},"_links":{"self":{"href":"https://api.github.com/repos/ansible/awx/pulls/464"},"html":{"href":"https://github.com/ansible/awx/pull/464"},"issue":{"href":"https://api.github.com/repos/ansible/awx/issues/464"},"comments":{"href":"https://api.github.com/repos/ansible/awx/issues/464/comments"},"review_comments":{"href":"https://api.github.com/repos/ansible/awx/pulls/464/comments"},"review_comment":{"href":"https://api.github.com/repos/ansible/awx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ansible/awx/pulls/464/commits"},"statuses":{"href":"https://api.github.com/repos/ansible/awx/statuses/098a407e257e3c7b775d7f26d357d966281e0c8c"}},"author_association":"MEMBER","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"AlanCoding","id":1385596,"avatar_url":"https://avatars3.githubusercontent.com/u/1385596?v=4","gravatar_id":"","url":"https://api.github.com/users/AlanCoding","html_url":"https://github.com/AlanCoding","followers_url":"https://api.github.com/users/AlanCoding/followers","following_url":"https://api.github.com/users/AlanCoding/following{/other_user}","gists_url":"https://api.github.com/users/AlanCoding/gists{/gist_id}","starred_url":"https://api.github.com/users/AlanCoding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlanCoding/subscriptions","organizations_url":"https://api.github.com/users/AlanCoding/orgs","repos_url":"https://api.github.com/users/AlanCoding/repos","events_url":"https://api.github.com/users/AlanCoding/events{/privacy}","received_events_url":"https://api.github.com/users/AlanCoding/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":55,"deletions":24,"changed_files":4}}
{"actor":{"display_login":"AlanCoding"}}