fixed bug where user is none but user.is_staff is called. fixed login bug in views.py