@never_cache
	def login(self, request, extra_context=None):
		self.set_requirement_redirect(request)
		
		# Redirect already-authenticated users to the index page.
		if request.user.is_authenticated():
			messages.add_message(request, messages.INFO, "You are already authenticated. Please log out if you wish to log in as a different user.")
			return HttpResponseRedirect(self.get_requirement_redirect(request))
		
		if request.method == 'POST':
			form = self.login_form(request=request, data=request.POST)
			if form.is_valid():
				redirect = self.get_requirement_redirect(request)
				login(request, form.get_user())
				
				if request.session.test_cookie_worked():
					request.session.delete_test_cookie()
				
				return HttpResponseRedirect(redirect)
		else:
			form = self.login_form(request)
		
		request.session.set_test_cookie()
		
		context = self.get_context()
		context.update(extra_context or {})
		context.update({
			'form': form
		})
		return self.login_page.render_to_response(request, extra_context=context)
Validates an assignment line and logs any errors and warnings.
dataset/ETHPy150Open ithinksw/philo/philo/contrib/waldo/models.py/LoginMultiView.login--crossover with--dataset/ETHPy150Open lyda/chkcrontab/chkcrontab_lib.py/CronLineAssignment.ValidateAndLog