On Aug 17, 2021, at 3:31 AM, Rainer Herbst <rainer.herbst@aip.de> wrote:
Dear all,
over the last couple of weeks, I have installed and configured mailman3 using the docker containers.
It took me some time, but now it works quite well. At last, I wanted to disable the sign-up because only LDAP users should be able to login.
As described in django_mailman3/views/user_adapter.py, I added the following line to my settings_local.py: ACCOUNT_ADAPTER = 'django_mailman3.views.user_adapter.DisableSignupAdapter'
This isn’t going to work unless you are using the ‘rolling’ releases. The changes for disabling signups haven’t yet been released unfortunately.
After that, an error is thrown: ModuleNotFoundError at /accounts/login/ No module named 'django_mailman3.views.user_adapter'
What could be the reason for that and how to solve it?
Thanks in advance! Rainer
Here is the traceback: Environment:
Request Method: GET Request URL: https://mailman.aip.de:1443/accounts/login/?next=%2Faccounts%2Flogin%2F
Django Version: 2.2.19 Python Version: 3.8.5 Installed Applications: ['hyperkitty', 'postorius', 'django_mailman3', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'rest_framework', 'django_gravatar', 'compressor', 'haystack', 'django_extensions', 'django_q', 'allauth', 'allauth.account', 'allauth.socialaccount'] Installed Middleware: ('django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware', 'django_mailman3.middleware.TimezoneMiddleware', 'postorius.middleware.PostoriusMiddleware')
Traceback:
File "/usr/lib/python3.8/site-packages/django/core/handlers/exception.py" in inner 34. response = get_response(request)
File "/usr/lib/python3.8/site-packages/django/core/handlers/base.py" in _get_response 115. response = self.process_exception_by_middleware(e, request)
File "/usr/lib/python3.8/site-packages/django/core/handlers/base.py" in _get_response 113. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python3.8/site-packages/django/views/generic/base.py" in view 71. return self.dispatch(request, *args, **kwargs)
File "/usr/lib/python3.8/site-packages/django/utils/decorators.py" in _wrapper 45. return bound_method(*args, **kwargs)
File "/usr/lib/python3.8/site-packages/django/views/decorators/debug.py" in sensitive_post_parameters_wrapper 76. return view(request, *args, **kwargs)
File "/usr/lib/python3.8/site-packages/allauth/account/views.py" in dispatch 146. return super(LoginView, self).dispatch(request, *args, **kwargs)
File "/usr/lib/python3.8/site-packages/allauth/account/views.py" in dispatch 74. response = super(RedirectAuthenticatedUserMixin, self).dispatch(
File "/usr/lib/python3.8/site-packages/django/views/generic/base.py" in dispatch 97. return handler(request, *args, **kwargs)
File "/usr/lib/python3.8/site-packages/allauth/account/views.py" in get 90. response = super(AjaxCapableProcessFormViewMixin, self).get(
File "/usr/lib/python3.8/site-packages/django/views/generic/edit.py" in get 133. return self.render_to_response(self.get_context_data())
File "/usr/lib/python3.8/site-packages/allauth/account/views.py" in get_context_data 173. signup_url = passthrough_next_redirect_url(
File "/usr/lib/python3.8/site-packages/allauth/account/utils.py" in passthrough_next_redirect_url 444. next_url = get_next_redirect_url(request, redirect_field_name)
File "/usr/lib/python3.8/site-packages/allauth/account/utils.py" in get_next_redirect_url 45. if not get_adapter(request).is_safe_url(redirect_to):
File "/usr/lib/python3.8/site-packages/allauth/account/adapter.py" in get_adapter 535. return import_attribute(app_settings.ADAPTER)(request)
File "/usr/lib/python3.8/site-packages/allauth/utils.py" in import_attribute 155. ret = getattr(importlib.import_module(pkg), attr)
File "/usr/lib/python3.8/importlib/__init__.py" in import_module 127. return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>" in _gcd_import 1014. <source code not available>
File "<frozen importlib._bootstrap>" in _find_and_load 991. <source code not available>
File "<frozen importlib._bootstrap>" in _find_and_load_unlocked 973. <source code not available>
Exception Type: ModuleNotFoundError at /accounts/login/ Exception Value: No module named 'django_mailman3.views.user_adapter'
Viele Grüße,
Rainer Herbst Leiter IT-Service Phone: +49 331 7499-257 e-mail: rainer.herbst@aip.de https://www.aip.de
Leibniz-Institut für Astrophysik Potsdam (AIP) An der Sternwarte 16, 14482 Potsdam
Vorstand: Prof. Dr. Matthias Steinmetz, Wolfram Rosenbach Stiftung bürgerlichen Rechts Stiftungsverzeichnis Brandenburg: 26 742-00/7026
Mailman-users mailing list -- mailman-users@mailman3.org To unsubscribe send an email to mailman-users-leave@mailman3.org https://lists.mailman3.org/mailman3/lists/mailman-users.mailman3.org/
-- thanks, Abhilash Raj (maxking)