dmpayton/django-admin-honeypot — Issue #3: Exception when trying to log in with email instead of username
Author: dchaplinsky
Created: 2011-11-25 12:47:14+00:00
State: open

Traceback:
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/handlers/base.py" in get_response
105. response = middleware_method(request, callback, callback_args, callback_kwargs)
File "/Users/dchaplinsky/Projects/babieslists/env/src/firepython/firepython/middleware.py" in process_view
369. return self._profile_wrap(callback)(*args, **callback_kwargs)
File "/Users/dchaplinsky/Projects/babieslists/env/lib/python2.6/site-packages/admin_honeypot/views.py" in admin_honeypot
18. context['form'].is_valid()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/forms/forms.py" in is_valid
121. return self.is_bound and not bool(self.errors)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/forms/forms.py" in _get_errors
112. self.full_clean()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/forms/forms.py" in full_clean
268. self._clean_form()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/forms/forms.py" in _clean_form
296. self.cleaned_data = self.clean()
File "/Users/dchaplinsky/Projects/babieslists/env/lib/python2.6/site-packages/admin_honeypot/forms.py" in clean
11. message = _("Your e-mail address is not your username. Try '%s' instead.") % user.username

Exception Type: NameError at /admin/
Exception Value: global name 'user' is not defined

Seems like a copy-paste style, and this is effective way to reveal that site admin is using honeypot admin