4👍
✅
File "C:\o\17\mysite\pet\forms.py" in authenticate_via_email
62. email = self.cleaned_data['email']
You are accessing an element in the dictionary that does not exists. Try this:
email = self.cleaned_data.get('email', None)
if email:
(...)
return None
1👍
def clean(self):
cleaned_data = super(LoginForm, self).clean()
if self._errors:
return cleaned_data
...
Easily solve this kind of problems. If the field is required, you can expect that the key is there
- [Django]-Save ManyToMany with through intermediary class
- [Django]-TypeError: 'RegexValidator' object is not iterable
- [Django]-How can I add choices to a timefield in a Django form?
- [Django]-SMTPAuthenticationError: (535, b'5.7.8 Username and Password not accepted in Django production?
Source:stackexchange.com