cheesy/moku/forms/auth.py
2025-11-23 10:57:34 +00:00

12 lines
446 B
Python
Executable file

from django.contrib.auth.forms import AuthenticationForm as BaseAuthenticationForm
from django.utils.translation import gettext_lazy as _
class AuthenticationForm(BaseAuthenticationForm):
error_messages = {
"invalid_login": _("sorry! that username and password didn't work."),
"inactive": _("your account has been deactivated."),
}
def clean_username(self):
return self.cleaned_data.get("username").lower()