Merge pull request #2593 from BrainWart/issue-2261

allow signup for social accounts when the provider is set up
This commit is contained in:
vabene1111
2023-09-12 15:50:32 +02:00
committed by GitHub
3 changed files with 7 additions and 2 deletions

View File

@@ -20,7 +20,9 @@ class AllAuthCustomAdapter(DefaultAccountAdapter):
if 'signup_token' in request.session and InviteLink.objects.filter(valid_until__gte=datetime.datetime.today(), used_by=None, uuid=request.session['signup_token']).exists():
signup_token = True
if (request.resolver_match.view_name == 'account_signup' or request.resolver_match.view_name == 'socialaccount_signup') and not settings.ENABLE_SIGNUP and not signup_token:
if request.resolver_match.view_name == 'account_signup' and not settings.ENABLE_SIGNUP and not signup_token:
return False
elif request.resolver_match.view_name == 'socialaccount_signup' and len(settings.SOCIAL_PROVIDERS) < 1:
return False
else:
return super(AllAuthCustomAdapter, self).is_open_for_signup(request)