HyperKitty: disable local signup
Spamming reasons, see puiterwijk.
This commit is contained in:
parent
3e22fcb28b
commit
74087cff26
2 changed files with 21 additions and 2 deletions
|
@ -13,3 +13,19 @@ def exclude_useless_errors(record):
|
||||||
if isinstance(exc_value, excluded_class):
|
if isinstance(exc_value, excluded_class):
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
# 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):
|
||||||
|
return True
|
||||||
|
|
|
@ -6,8 +6,6 @@ Django settings for HyperKitty + Postorius
|
||||||
import os
|
import os
|
||||||
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
|
||||||
import django_fedora
|
|
||||||
|
|
||||||
# SECURITY WARNING: keep the secret key used in production secret!
|
# SECURITY WARNING: keep the secret key used in production secret!
|
||||||
SECRET_KEY = '{{ mailman_hyperkitty_cookie_key }}'
|
SECRET_KEY = '{{ mailman_hyperkitty_cookie_key }}'
|
||||||
|
|
||||||
|
@ -241,6 +239,9 @@ ACCOUNT_EMAIL_REQUIRED = True
|
||||||
ACCOUNT_EMAIL_VERIFICATION = "mandatory"
|
ACCOUNT_EMAIL_VERIFICATION = "mandatory"
|
||||||
ACCOUNT_DEFAULT_HTTP_PROTOCOL = "https"
|
ACCOUNT_DEFAULT_HTTP_PROTOCOL = "https"
|
||||||
ACCOUNT_UNIQUE_EMAIL = True
|
ACCOUNT_UNIQUE_EMAIL = True
|
||||||
|
# Disable local signup
|
||||||
|
ACCOUNT_ADAPTER = "django_fedora.NoLocalSignUpAdapter"
|
||||||
|
SOCIALACCOUNT_ADAPTER = "django_fedora.SignUpEnabledSocialAdapter"
|
||||||
|
|
||||||
SOCIALACCOUNT_PROVIDERS = {
|
SOCIALACCOUNT_PROVIDERS = {
|
||||||
'openid': {
|
'openid': {
|
||||||
|
@ -336,6 +337,8 @@ REST_FRAMEWORK = {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
import django_fedora
|
||||||
|
|
||||||
# A sample logging configuration. The only tangible logging
|
# A sample logging configuration. The only tangible logging
|
||||||
# performed by this configuration is to send an email to
|
# performed by this configuration is to send an email to
|
||||||
# the site admins on every HTTP 500 error when DEBUG=False.
|
# the site admins on every HTTP 500 error when DEBUG=False.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue