{"action":"created","issue":{"url":"https://api.github.com/repos/fusionbox/django-authtools/issues/41","labels_url":"https://api.github.com/repos/fusionbox/django-authtools/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/fusionbox/django-authtools/issues/41/comments","events_url":"https://api.github.com/repos/fusionbox/django-authtools/issues/41/events","html_url":"https://github.com/fusionbox/django-authtools/issues/41","id":90379395,"number":41,"title":"[Minor issue] Warning: `request.REQUEST` is deprecated","user":{"login":"gkeller2","id":2974603,"avatar_url":"https://avatars.githubusercontent.com/u/2974603?v=3","gravatar_id":"","url":"https://api.github.com/users/gkeller2","html_url":"https://github.com/gkeller2","followers_url":"https://api.github.com/users/gkeller2/followers","following_url":"https://api.github.com/users/gkeller2/following{/other_user}","gists_url":"https://api.github.com/users/gkeller2/gists{/gist_id}","starred_url":"https://api.github.com/users/gkeller2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkeller2/subscriptions","organizations_url":"https://api.github.com/users/gkeller2/orgs","repos_url":"https://api.github.com/users/gkeller2/repos","events_url":"https://api.github.com/users/gkeller2/events{/privacy}","received_events_url":"https://api.github.com/users/gkeller2/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-23T12:51:01Z","updated_at":"2015-07-20T19:49:00Z","closed_at":"2015-07-20T19:49:00Z","body":"Hi there!\r\n\r\nThe CBV **WithNextUrlMixin** currently generates the following warnings:\r\n\r\n```\r\nRemovedInDjango19Warning: `request.REQUEST` is deprecated, use `request.GET` or `request.POST` instead.\r\n  if self.redirect_field_name in self.request.REQUEST:\r\n\r\nRemovedInDjango19Warning: `request.REQUEST` is deprecated, use `request.GET` or `request.POST` instead.\r\n  redirect_to = self.request.REQUEST[self.redirect_field_name]\r\n```\r\n\r\nIt's not a major concern at the moment, but I thought I'd contribute this re-write:\r\n\r\n```\r\ndef get_next_url(self):\r\n        # if self.redirect_field_name in self.request.REQUEST:\r\n        #     redirect_to = self.request.REQUEST[self.redirect_field_name]\r\n        #     if is_safe_url(redirect_to, host=self.request.get_host()):\r\n        #         return redirect_to\r\n        redirect_to = self.request.POST.get(self.redirect_field_name,\r\n                                            self.request.GET.get(self.redirect_field_name, ''))\r\n        if is_safe_url(redirect_to, host=self.request.get_host()):\r\n            return redirect_to\r\n```\r\n\r\nI'm leaving the old code commented above, so that you can easily compare the change.\r\n\r\nThanks for all the hard work. ;-)"},"comment":{"url":"https://api.github.com/repos/fusionbox/django-authtools/issues/comments/123006131","html_url":"https://github.com/fusionbox/django-authtools/issues/41#issuecomment-123006131","issue_url":"https://api.github.com/repos/fusionbox/django-authtools/issues/41","id":123006131,"user":{"login":"acatton","id":3966553,"avatar_url":"https://avatars.githubusercontent.com/u/3966553?v=3","gravatar_id":"","url":"https://api.github.com/users/acatton","html_url":"https://github.com/acatton","followers_url":"https://api.github.com/users/acatton/followers","following_url":"https://api.github.com/users/acatton/following{/other_user}","gists_url":"https://api.github.com/users/acatton/gists{/gist_id}","starred_url":"https://api.github.com/users/acatton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/acatton/subscriptions","organizations_url":"https://api.github.com/users/acatton/orgs","repos_url":"https://api.github.com/users/acatton/repos","events_url":"https://api.github.com/users/acatton/events{/privacy}","received_events_url":"https://api.github.com/users/acatton/received_events","type":"User","site_admin":false},"created_at":"2015-07-20T19:49:00Z","updated_at":"2015-07-20T19:49:00Z","body":"#35 has been merged. Closing this issue."}}