From df820b42bd1f3fbb22cc68d6ce3ce13defb2f101 Mon Sep 17 00:00:00 2001 From: Bruno Alla Date: Mon, 24 Mar 2025 22:32:34 +0000 Subject: [PATCH] Update django-allauth setting --- {{cookiecutter.project_slug}}/config/settings/base.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 22876096c..ba0a7ce46 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -337,10 +337,10 @@ ACCOUNT_ALLOW_REGISTRATION = env.bool("DJANGO_ACCOUNT_ALLOW_REGISTRATION", True) # https://docs.allauth.org/en/latest/account/configuration.html ACCOUNT_LOGIN_METHODS = {"{{cookiecutter.username_type}}"} # https://docs.allauth.org/en/latest/account/configuration.html -ACCOUNT_EMAIL_REQUIRED = True -{%- if cookiecutter.username_type == "email" %} -# https://docs.allauth.org/en/latest/account/configuration.html -ACCOUNT_USERNAME_REQUIRED = False +{%- if cookiecutter.username_type == "username" %} +ACCOUNT_SIGNUP_FIELDS = ["email*", "username*", "password1*", "password2*"] +{%- else %} +ACCOUNT_SIGNUP_FIELDS = ["email*", "password1*", "password2*"] # https://docs.allauth.org/en/latest/account/configuration.html ACCOUNT_USER_MODEL_USERNAME_FIELD = None {%- endif %}