Describe the bug
When trying to send any email from within the system, a notification appears saying "We're having trouble processing that request" however the email is still sent.
In the logs, I see the following:
2023-11-13 23:21:52,229 django.request ERROR Internal Server Error: /api/admin/members/1/sendwelcome/
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/asgiref/sync.py", line 534, in thread_handler
raise exc_info[1]
File "/usr/local/lib/python3.10/site-packages/django/core/handlers/exception.py", line 38, in inner
response = await get_response(request)
File "/usr/local/lib/python3.10/site-packages/django/core/handlers/base.py", line 233, in _get_response_async
response = await wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python3.10/site-packages/asgiref/sync.py", line 479, in __call__
ret: _R = await loop.run_in_executor(
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.10/site-packages/asgiref/sync.py", line 538, in thread_handler
return func(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
return view_func(*args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/django/views/generic/base.py", line 70, in view
return self.dispatch(request, *args, **kwargs)
File "/usr/local/lib/python3.10/site-packages/rest_framework/views.py", line 509, in dispatch
response = self.handle_exception(exc)
File "/usr/local/lib/python3.10/site-packages/rest_framework/views.py", line 469, in handle_exception
self.raise_uncaught_exception(exc)
File "/usr/local/lib/python3.10/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
raise exc
File "/usr/local/lib/python3.10/site-packages/rest_framework/views.py", line 506, in dispatch
response = handler(request, *args, **kwargs)
File "/usr/src/app/memberportal/api_admin_tools/views.py", line 338, in post
member.email_welcome()
File "/usr/src/app/memberportal/profile/models.py", line 199, in email_welcome
if self.__send_email(f"Welcome to {config.SITE_OWNER}", email_string):
File "/usr/src/app/memberportal/profile/models.py", line 149, in __send_email
return send_single_email(self, self.email, subject, subject, body)
File "/usr/src/app/memberportal/services/emails.py", line 35, in send_single_email
user.log_event(
TypeError: User.log_event() takes from 2 to 3 positional arguments but 4 were given
Describe the bug When trying to send any email from within the system, a notification appears saying "We're having trouble processing that request" however the email is still sent.
In the logs, I see the following:
To Reproduce
Expected behavior
The email is sent without errors being logged.