1234567891011121314151617181920212223 |
- from django.utils.translation import gettext_lazy as _
- from django.contrib.auth.models import AbstractUser
- from allauth.account.adapter import DefaultAccountAdapter
- class CustomAccountAdapter(DefaultAccountAdapter):
- error_messages = {
- #
- "username_blacklisted": _(
- "Username can not be used. Please use other username."
- ),
- "username_taken": AbstractUser._meta.get_field("username").error_messages[
- "unique"
- ],
- "too_many_login_attempts": _(
- "Too many failed login attempts. Try again later."
- ),
- "email_taken": _("A user is already registered with this e-mail address."),
-
- }
-
|