Although it's a bit late, but in case it helps someone.
You need to create your own custom account adapter by subclassing DefaultAccountAdapter and setting
class UserAccountAdapter(DefaultAccountAdapter): def save_user(self, request, user, form, commit=True): """ This is called when saving user via allauth registration. We override this to set additional data on user object. """
and you also need to define the following settings:
ACCOUNT_ADAPTER = 'api.adapter.UserAccountAdapter'
It is also useful if you have a custom RegisterForm function for creating other models during user registration, and you need to make an atomic transaction that would prevent any data from being stored in the database if all of them fail.
DefaultAdapter for django-allauth saves the user, so if you have an error in the save method of your RegisterForm custom parameter, the user will still be saved in the database.
So, for those facing this problem, your CustomAdpater will look like this:
class UserAccountAdapter (DefaultAccountAdapter):
def save_user(self, request, user, form, commit=False): """ This is called when saving user via allauth registration. We override this to set additional data on user object. """
Then you can decorate your own RegisterForm file with @transaction.atomic
@transaction.atomic def save(self, request, user): user.save()