error 500 when generating mail
Discussed with Carlos
"the template does not have a language hence doesn’t have a locale"
- error on general appointments.
ERROR 2021-07-28 14:48:35,312 log 2392828 140276385081152 Internal Server Error: /mail_templates/3/generate/12 Traceback (most recent call last): File "/usr/lib/smasch/env/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner response = get_response(request) File "/usr/lib/smasch/env/lib/python3.8/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/views/mails.py", line 107, in generate stream = mail_template.apply(instance, request.user, stream) File "/usr/lib/smasch/web/models/mail_template.py", line 218, in apply study_subject = visit.subject AttributeError: 'NoneType' object has no attribute 'subject'
- error on appointments with subject
Traceback (most recent call last): File "/usr/lib/smasch/env/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner response = get_response(request) File "/usr/lib/smasch/env/lib/python3.8/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/views/mails.py", line 107, in generate stream = mail_template.apply(instance, request.user, stream) File "/usr/lib/smasch/web/models/mail_template.py", line 228, in apply with setlocale(locale_name): File "/usr/lib/python3.8/contextlib.py", line 113, in __enter__ return next(self.gen) File "/usr/lib/smasch/web/models/mail_template.py", line 33, in setlocale yield locale.setlocale(locale.LC_TIME, name) File "/usr/lib/python3.8/locale.py", line 608, in setlocale return _setlocale(category, locale) locale.Error: unsupported locale setting