Skip to content

Commit bf4bd71

Browse files
Fixes #12967 Allow the social signup via social authentication even i… (#12971)
* Fixes #12967 Allow the social signup via social authentication even if the local signup is closed --------- Co-authored-by: Giovanni Allegri <[email protected]>
1 parent 24aae53 commit bf4bd71

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

geonode/context_processors.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def resource_urls(request):
4646
STATIC_URL=settings.STATIC_URL,
4747
CATALOGUE_BASE_URL=default_catalogue_backend()["URL"],
4848
ACCOUNT_OPEN_SIGNUP=settings.ACCOUNT_OPEN_SIGNUP,
49+
ACCOUNT_OPEN_SOCIALSIGNUP=settings.ACCOUNT_OPEN_SOCIALSIGNUP,
4950
ACCOUNT_APPROVAL_REQUIRED=settings.ACCOUNT_APPROVAL_REQUIRED,
5051
VERSION=get_version(),
5152
SITE_NAME=site.name,

geonode/people/adapters.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ class SocialAccountAdapter(DefaultSocialAccountAdapter):
220220
"""
221221

222222
def is_open_for_signup(self, request, sociallogin):
223-
return _site_allows_signup(request)
223+
# https://github.com/GeoNode/geonode/issues/12967
224+
return settings.ACCOUNT_OPEN_SOCIALSIGNUP
224225

225226
def populate_user(self, request, sociallogin, data):
226227
"""This method is called when a new sociallogin is created"""

geonode/settings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,6 +1944,7 @@ def get_geonode_catalogue_service():
19441944
)
19451945

19461946
ACCOUNT_OPEN_SIGNUP = ast.literal_eval(os.environ.get("ACCOUNT_OPEN_SIGNUP", "True"))
1947+
# ref https://github.com/GeoNode/geonode/issues/12967
19471948
ACCOUNT_OPEN_SOCIALSIGNUP = ast.literal_eval(os.environ.get("ACCOUNT_OPEN_SOCIALSIGNUP", "True"))
19481949
ACCOUNT_APPROVAL_REQUIRED = ast.literal_eval(os.getenv("ACCOUNT_APPROVAL_REQUIRED", "False"))
19491950
ACCOUNT_ADAPTER = "geonode.people.adapters.LocalAccountAdapter"
@@ -1959,6 +1960,7 @@ def get_geonode_catalogue_service():
19591960

19601961
SOCIALACCOUNT_AUTO_SIGNUP = ast.literal_eval(os.environ.get("SOCIALACCOUNT_AUTO_SIGNUP", "True"))
19611962
SOCIALACCOUNT_LOGIN_ON_GET = ast.literal_eval(os.environ.get("SOCIALACCOUNT_LOGIN_ON_GET", "True"))
1963+
19621964
# This will hide or show local registration form in allauth view. True will show form
19631965
SOCIALACCOUNT_WITH_GEONODE_LOCAL_SINGUP = ast.literal_eval(
19641966
os.environ.get("SOCIALACCOUNT_WITH_GEONODE_LOCAL_SINGUP", "True")

0 commit comments

Comments
 (0)