﻿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
35530	`django.contrib.auth.login` inconsistently guards `request.user`	Jaap Roes	Jaap Roes	"In https://github.com/django/django/blob/a0c44d4e23f8f509757f97f28fbbb1ced3382361/django/contrib/auth/__init__.py#L102-L152 `request.user` is accessed twice.

The first time here:

https://github.com/django/django/blob/a0c44d4e23f8f509757f97f28fbbb1ced3382361/django/contrib/auth/__init__.py#L109-L110

The second time here:

https://github.com/django/django/blob/a0c44d4e23f8f509757f97f28fbbb1ced3382361/django/contrib/auth/__init__.py#L149-L150

The first time there is no `hasattr` guard to verify if the `request` object has a `user` attribute. The second time there is.

Is the `hasattr` check in the second case redundant? Or should the first case be guarded as well?"	Cleanup/optimization	closed	contrib.auth	dev	Normal	fixed		Jacob	Ready for checkin	1	0	0	0	0	0
