﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24501	Documentation for user_passes_test is wrong and confusing	Janne Enberg	Matt Seymour	"On the page https://docs.djangoproject.com/en/1.7/topics/auth/default/ it says on ""Limiting access to logged-in users that pass a test"" ( https://docs.djangoproject.com/en/1.7/topics/auth/default/#limiting-access-to-logged-in-users-that-pass-a-test ) the following:

  {{{
  The simple way is to run your test on request.user in the view directly. For example, this view checks to make sure the user has an email in the desired domain:

  def my_view(request):
      if not request.user.email.endswith('@example.com'):
          return HttpResponse(""You can't vote in this poll."")
      # ...
  }}}

Then under that there's the ""user_passes_test"" -documentation and it's mentioned to be a shortcut for the above.

This is just plain wrong, user_passes_test checks for something, then redirects to login page if the test fails. It does not return HttpResponse(""You can't vote in this poll."") and it definitely does not return the 403 that makes me expect it to return.

Also there is only a very casual mention of the ""login_url"" argument but no mention of what it could possibly be used for, e.g. redirecting users there if the test fails.
"	Cleanup/optimization	closed	Documentation	1.7	Normal	fixed			Accepted	1	0	0	0	1	0
