why don't you do:
```python
try:
  username = request.user.username
except KeyError:
  username = login_form.cleaned_data['username']
```
It won't be bound to the class names that way