The issue I'm facing is the custom adapter that I created is not used by django all-auth. I have specified the module path also still django does not call save_user method in the adapter.py file.
adapter:
from allauth.account.adapter import DefaultAccountAdapter
class UserAccountAdapter(DefaultAccountAdapter):
print("class loading ")
def get_login_redirect_url(self, request):
print(f"GET request dict is {request.GET}")
return reverse('users:home')
def save_user(self, request, user, form):
print("working in save user", form)
user = super(UserAccountAdapter, self).save(request, user, form)
return user
base.py (my settings file)
ACCOUNT_FORMS = {
'signup': 'users.forms.UserRegistrationForm'
}
ACCOUNT_ADAPTER = "spotify.adapter.UserAccountAdapter"
project structure:
myproject
-- app1
-- views.py etc.,
myproject
-- settings (folder)
-- base.py (this is the settings file django uses)
-- wsgi.py
-- adapter.py
While server reloads the print statement works but the method is not called. I have also placed the adapter.py file inside users app too and tried changing the path but it does not work. Would be glad if someone has encountered the same and found the solution.