diff --git a/CHANGELOG.rst b/CHANGELOG.rst index a46793f6b4c4c58f3dfa65b749027a29bc0e1959..6a3521ecb9c3e5fd9d5880c38022d03668c7ca4b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -9,6 +9,11 @@ and this project adheres to `Semantic Versioning`_. Unreleased ---------- +Fixed +~~~~~ + +* ACCOUNT_ADAPTER was overriden by invitations + Added ~~~~~ diff --git a/aleksis/core/settings.py b/aleksis/core/settings.py index 00c0a6605e5c58d0c8078150d567362a73611ee3..17ac7a96fe31f6e78f0305e9b96818b2b17ab674 100644 --- a/aleksis/core/settings.py +++ b/aleksis/core/settings.py @@ -367,8 +367,6 @@ ACCOUNT_USERNAME_VALIDATORS = "aleksis.core.util.auth_helpers.custom_username_va # Configuration for django-invitations -# Use custom account adapter -ACCOUNT_ADAPTER = "invitations.models.InvitationsAdapter" # Expire invitations are configured amout of days INVITATIONS_INVITATION_EXPIRY = _settings.get("auth.invitation.expiry", 3) # Use email prefix configured for django-allauth diff --git a/aleksis/core/util/auth_helpers.py b/aleksis/core/util/auth_helpers.py index 6edfac83373882d077d0a588d822fd3a0d0cc9b4..a27910250bf5386e4a24344e2a997d1fc53a7610 100644 --- a/aleksis/core/util/auth_helpers.py +++ b/aleksis/core/util/auth_helpers.py @@ -7,8 +7,8 @@ from django.contrib.auth.validators import ASCIIUsernameValidator from django.core.validators import RegexValidator from django.http import HttpRequest -from allauth.account.adapter import DefaultAccountAdapter from allauth.socialaccount.adapter import DefaultSocialAccountAdapter +from invitations.models import InvitationsAdapter from oauth2_provider.models import AbstractApplication from oauth2_provider.oauth2_validators import OAuth2Validator from oauth2_provider.scopes import BaseScopes @@ -37,7 +37,7 @@ class OurSocialAccountAdapter(DefaultSocialAccountAdapter): return super().validate_disconnect(account, accounts) -class OurAccountAdapter(DefaultAccountAdapter): +class OurAccountAdapter(InvitationsAdapter): """Customised adapter to allow to disable signup.""" def is_open_for_signup(self, request): diff --git a/aleksis/core/views.py b/aleksis/core/views.py index 789410c80f0eaf8aa8d7c7302f701e08e1432276..32e83c3746630ddf96e5c179180dbfb2face50d2 100644 --- a/aleksis/core/views.py +++ b/aleksis/core/views.py @@ -36,7 +36,7 @@ from django.views.generic.list import ListView import reversion from allauth.account.utils import _has_verified_for_login, send_email_confirmation -from allauth.account.views import PasswordChangeView, SignupView, PasswordResetView +from allauth.account.views import PasswordChangeView, PasswordResetView, SignupView from allauth.socialaccount.adapter import get_adapter from allauth.socialaccount.models import SocialAccount from celery_progress.views import get_progress