Skip to content

Conversation

chellman
Copy link

@chellman chellman commented Apr 1, 2025

AllAuth v65 has new signup field settings:

https://docs.allauth.org/en/latest/release-notes/recent.html#note-worthy-changes

Deprecation warnings are raised if you continue using the old settings, so it seems worth changing.

@vikito755
Copy link

When can this be merged? I'm seeing the same issue.



class RegisterSerializer(serializers.Serializer):
using_signup_fields = hasattr(allauth_account_settings, "SIGNUP_FIELDS")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

username = serializers.CharField(
        max_length=get_username_max_length(),
        min_length=allauth_account_settings.SIGNUP_FIELDS['username'].get('min_length', 1),
        required=allauth_account_settings.SIGNUP_FIELDS.get('username', {}).get('required', False)
    ) if 'username' in allauth_account_settings.SIGNUP_FIELDS else None

    email = serializers.EmailField(
        required=allauth_account_settings.SIGNUP_FIELDS.get('email', {}).get('required', False)
    ) if 'email' in allauth_account_settings.SIGNUP_FIELDS else None

You need to do like this way. because everytime we cannot assume that username is there in signup fields. if i go with your code so it will break and return key error of username.

@gtlYashParmar
Copy link

@chellman
In current version i am stuck in one point. when i remove the username field from the signup fields. it is still asking for username while calling register api. i have tried with couple of different allauth configuration but not working. as i reviewed above this code is working well. i initially try with your code but it getting key error of username.

@Mte90
Copy link

Mte90 commented Sep 9, 2025

@iMerica can you do a new release with this fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants