ansible/roles/mailman/files/django_fedora_nosignup.py
Aurélien Bompard f40ce9d969 Mailman: split the django_fedora module
Some imports need to read the config file, which creates a import loop.
2017-07-21 09:06:09 +00:00

14 lines
410 B
Python

# Disable local signup
from allauth.account.adapter import DefaultAccountAdapter
from allauth.socialaccount.adapter import DefaultSocialAccountAdapter
class NoLocalSignUpAdapter(DefaultAccountAdapter):
def is_open_for_signup(self, request):
return False
class SignUpEnabledSocialAdapter(DefaultSocialAccountAdapter):
def is_open_for_signup(self, request, sociallogin):
return True