{"action":"created","issue":{"url":"https://api.github.com/repos/mitodl/open-discussions/issues/1535","repository_url":"https://api.github.com/repos/mitodl/open-discussions","labels_url":"https://api.github.com/repos/mitodl/open-discussions/issues/1535/labels{/name}","comments_url":"https://api.github.com/repos/mitodl/open-discussions/issues/1535/comments","events_url":"https://api.github.com/repos/mitodl/open-discussions/issues/1535/events","html_url":"https://github.com/mitodl/open-discussions/pull/1535","id":385279142,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM0Mjg1MTQ4","number":1535,"title":"Add django-hijack","user":{"login":"mbertrand","id":187676,"node_id":"MDQ6VXNlcjE4NzY3Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/187676?v=4","gravatar_id":"","url":"https://api.github.com/users/mbertrand","html_url":"https://github.com/mbertrand","followers_url":"https://api.github.com/users/mbertrand/followers","following_url":"https://api.github.com/users/mbertrand/following{/other_user}","gists_url":"https://api.github.com/users/mbertrand/gists{/gist_id}","starred_url":"https://api.github.com/users/mbertrand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbertrand/subscriptions","organizations_url":"https://api.github.com/users/mbertrand/orgs","repos_url":"https://api.github.com/users/mbertrand/repos","events_url":"https://api.github.com/users/mbertrand/events{/privacy}","received_events_url":"https://api.github.com/users/mbertrand/received_events","type":"User","site_admin":false},"labels":[{"id":627437808,"node_id":"MDU6TGFiZWw2Mjc0Mzc4MDg=","url":"https://api.github.com/repos/mitodl/open-discussions/labels/Needs%20Review","name":"Needs Review","color":"f9d0c4","default":false}],"state":"open","locked":false,"assignee":{"login":"pdpinch","id":430126,"node_id":"MDQ6VXNlcjQzMDEyNg==","avatar_url":"https://avatars3.githubusercontent.com/u/430126?v=4","gravatar_id":"","url":"https://api.github.com/users/pdpinch","html_url":"https://github.com/pdpinch","followers_url":"https://api.github.com/users/pdpinch/followers","following_url":"https://api.github.com/users/pdpinch/following{/other_user}","gists_url":"https://api.github.com/users/pdpinch/gists{/gist_id}","starred_url":"https://api.github.com/users/pdpinch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdpinch/subscriptions","organizations_url":"https://api.github.com/users/pdpinch/orgs","repos_url":"https://api.github.com/users/pdpinch/repos","events_url":"https://api.github.com/users/pdpinch/events{/privacy}","received_events_url":"https://api.github.com/users/pdpinch/received_events","type":"User","site_admin":false},"assignees":[{"login":"pdpinch","id":430126,"node_id":"MDQ6VXNlcjQzMDEyNg==","avatar_url":"https://avatars3.githubusercontent.com/u/430126?v=4","gravatar_id":"","url":"https://api.github.com/users/pdpinch","html_url":"https://github.com/pdpinch","followers_url":"https://api.github.com/users/pdpinch/followers","following_url":"https://api.github.com/users/pdpinch/following{/other_user}","gists_url":"https://api.github.com/users/pdpinch/gists{/gist_id}","starred_url":"https://api.github.com/users/pdpinch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pdpinch/subscriptions","organizations_url":"https://api.github.com/users/pdpinch/orgs","repos_url":"https://api.github.com/users/pdpinch/repos","events_url":"https://api.github.com/users/pdpinch/events{/privacy}","received_events_url":"https://api.github.com/users/pdpinch/received_events","type":"User","site_admin":false}],"milestone":null,"comments":7,"created_at":"2018-11-28T13:55:51Z","updated_at":"2018-11-30T13:49:30Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/mitodl/open-discussions/pulls/1535","html_url":"https://github.com/mitodl/open-discussions/pull/1535","diff_url":"https://github.com/mitodl/open-discussions/pull/1535.diff","patch_url":"https://github.com/mitodl/open-discussions/pull/1535.patch"},"body":"#### Pre-Flight checklist\r\n- [ ] Testing\r\n  - [ ] Code is tested\r\n  - [x] Changes have been manually tested\r\n\r\n#### What are the relevant tickets?\r\nCloses #\r\n\r\n#### What's this PR do?\r\nAdds django-hijack so admins can log in as another user.\r\n\r\n#### How should this be manually tested?\r\nLog in as someone with access to the admin console.  Go to `/admin/auth/user/`.  Next to each user should be a button `Log in as <username>`.  Click one of those buttons.  You should be able to view the channels that user has access to, create posts and comments as that user, and edit the user's profile.\r\n\r\n#### Screenshots (if appropriate)\r\nAdmin:\r\n<img width=\"1152\" alt=\"screen shot 2018-11-28 at 8 54 49 am\" src=\"https://user-images.githubusercontent.com/187676/49156408-53aec880-f2eb-11e8-8c75-b682959b0235.png\">\r\n\r\nLogged in via Hijack:\r\n<img width=\"1061\" alt=\"screen shot 2018-11-28 at 8 53 58 am\" src=\"https://user-images.githubusercontent.com/187676/49156409-53aec880-f2eb-11e8-98f7-e28ebbc6d8ac.png\">\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mitodl/open-discussions/issues/comments/443208686","html_url":"https://github.com/mitodl/open-discussions/pull/1535#issuecomment-443208686","issue_url":"https://api.github.com/repos/mitodl/open-discussions/issues/1535","id":443208686,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MzIwODY4Ng==","user":{"login":"mbertrand","id":187676,"node_id":"MDQ6VXNlcjE4NzY3Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/187676?v=4","gravatar_id":"","url":"https://api.github.com/users/mbertrand","html_url":"https://github.com/mbertrand","followers_url":"https://api.github.com/users/mbertrand/followers","following_url":"https://api.github.com/users/mbertrand/following{/other_user}","gists_url":"https://api.github.com/users/mbertrand/gists{/gist_id}","starred_url":"https://api.github.com/users/mbertrand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbertrand/subscriptions","organizations_url":"https://api.github.com/users/mbertrand/orgs","repos_url":"https://api.github.com/users/mbertrand/repos","events_url":"https://api.github.com/users/mbertrand/events{/privacy}","received_events_url":"https://api.github.com/users/mbertrand/received_events","type":"User","site_admin":false},"created_at":"2018-11-30T13:49:30Z","updated_at":"2018-11-30T13:49:30Z","author_association":"CONTRIBUTOR","body":"I can add something like this to the social-auth views, though not sure if it's necessary:\r\n```\r\n        if request.session.get('is_hijacked_user', False):\r\n            return Response(status=status.HTTP_403_FORBIDDEN)\r\n```"}}
{"actor":{"display_login":"mbertrand"}}