`Send email` in `Kit requests` in throws error
Environment:
Request Method: GET
Request URL: http://pdp-test.lcsb.uni.lu/equipment_and_rooms/kit_requests/2021-03-01/2021-03-20/
Django Version: 3.1.4
Python Version: 3.6.13
Installed Applications:
['django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django_cleanup',
'django_cron',
'django_otp',
'django_otp.plugins.otp_static',
'django_otp.plugins.otp_totp',
'two_factor',
'web',
'stronghold',
'debug_toolbar']
Installed Middleware:
['web.middleware.PrivacyNoticeMiddleware',
'debug_toolbar.middleware.DebugToolbarMiddleware',
'django.middleware.security.SecurityMiddleware',
'whitenoise.middleware.WhiteNoiseMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django_otp.middleware.OTPMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'stronghold.middleware.LoginRequiredMiddleware']
Traceback (most recent call last):
File "/usr/lib/smasch/web/views/kit.py", line 223, in kit_requests_send_mail
send_mail(data)
File "/usr/lib/smasch/web/views/kit.py", line 216, in send_mail
EmailSender().send_email(title, email_body, recipients, cc_recipients)
File "/usr/lib/smasch/web/smash_email.py", line 31, in send_email
message.send()
File "/usr/lib/smasch/env/lib/python3.6/site-packages/django/core/mail/message.py", line 284, in send
return self.get_connection(fail_silently).send_messages([self])
File "/usr/lib/smasch/env/lib/python3.6/site-packages/django/core/mail/backends/smtp.py", line 102, in send_messages
new_conn_created = self.open()
File "/usr/lib/smasch/env/lib/python3.6/site-packages/django/core/mail/backends/smtp.py", line 62, in open
self.connection = self.connection_class(self.host, self.port, **connection_params)
File "/usr/lib/python3.6/smtplib.py", line 251, in __init__
(code, msg) = self.connect(host, port)
File "/usr/lib/python3.6/smtplib.py", line 336, in connect
self.sock = self._get_socket(host, port, self.timeout)
File "/usr/lib/python3.6/smtplib.py", line 307, in _get_socket
self.source_address)
File "/usr/lib/python3.6/socket.py", line 724, in create_connection
raise err
File "/usr/lib/python3.6/socket.py", line 713, in create_connection
sock.connect(sa)
During handling of the above exception ([Errno 111] Connection refused), another exception occurred:
File "/usr/lib/smasch/env/lib/python3.6/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/usr/lib/smasch/env/lib/python3.6/site-packages/django/core/handlers/base.py", line 179, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/smasch/web/decorators.py", line 105, in func_wrapper
return func(thing, *args, **kwargs)
File "/usr/lib/smasch/web/views/kit.py", line 229, in kit_requests_send_mail
e.message, e.args))
Exception Type: AttributeError at /equipment_and_rooms/kit_requests/2021-03-01/2021-03-20/
Exception Value: 'ConnectionRefusedError' object has no attribute 'message'
Edited by Ewa Smula