﻿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
29258	Add an error message when passing an authentication backend class to login()'s backend argument where a string is expected	Ryan Govostes	Abeer Upadhyay	"I had written

{{{
from django.contrib.auth.backends import ModelBackend
...
login(request, user, backend=ModelBackend)
}}}

which generated a very bizarre exception ""Object of type 'type' is not JSON serializable"" from the sessions middleware with no backtrace leading back to my code.

In the documentation for ""Selecting the authentication backend"", it says: ""the value of the backend argument or the user.backend attribute should be a dotted import path string (like that found in AUTHENTICATION_BACKENDS), not the actual backend class.""

It would be nice to catch this, e.g., `assert isinstance(backend, str)` closer to the site of the mistake."	Cleanup/optimization	closed	contrib.auth	2.0	Normal	fixed			Accepted	1	0	0	1	1	0
