Preview Certificate error

I preview certificate show text

and log error

tutor_local-lms-1          | 2025-01-07 04:35:23,261 ERROR 23 [common.djangoapps.util.views] [user 2613] [ip xxxx] views.py:148 - Error in django view.
tutor_local-lms-1          | Traceback (most recent call last):
tutor_local-lms-1          |   File "/openedx/edx-platform/common/djangoapps/util/views.py", line 139, in inner
tutor_local-lms-1          |     return func(request, *args, **kwargs)
tutor_local-lms-1          |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tutor_local-lms-1          |   File "/openedx/venv/lib/python3.11/site-packages/edx_django_utils/plugins/pluggable_override.py", line 77, in wrapper
tutor_local-lms-1          |     return prev_fn(*args, **kwargs)
tutor_local-lms-1          |            ^^^^^^^^^^^^^^^^^^^^^^^^
tutor_local-lms-1          |   File "/openedx/edx-platform/lms/djangoapps/certificates/views/webview.py", line 575, in render_html_view
tutor_local-lms-1          |     _update_certificate_context(context, course, course_overview, user_certificate, platform_name)
tutor_local-lms-1          |   File "/openedx/edx-platform/lms/djangoapps/certificates/views/webview.py", line 124, in _update_certificate_context
tutor_local-lms-1          |     context['certificate_date_issued'] = strftime_localized(date, settings.CERTIFICATE_DATE_FORMAT)
tutor_local-lms-1          |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tutor_local-lms-1          |   File "/openedx/edx-platform/common/djangoapps/util/date_utils.py", line 215, in strftime_localized
tutor_local-lms-1          |     formatted_date = re.sub(r"%-.|%.|%", process_percent_code, format)
tutor_local-lms-1          |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tutor_local-lms-1          |   File "/opt/pyenv/versions/3.11.8/lib/python3.11/re/__init__.py", line 185, in sub
tutor_local-lms-1          |     return _compile(pattern, flags).sub(repl, string, count)
tutor_local-lms-1          |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tutor_local-lms-1          |   File "/openedx/edx-platform/common/djangoapps/util/date_utils.py", line 180, in process_percent_code
tutor_local-lms-1          |     part = pgettext('month name', MONTHS[dtime.month])
tutor_local-lms-1          |                                          ^^^^^^^^^^^
tutor_local-lms-1          | AttributeError: 'NoneType' object has no attribute 'month'

How to fix it.
I use tutor version 19(sumac)

At a quick glance, it seems like the issues occurs when trying to render the date of when certificate has been issued, because instead of date you get None, which can’t be formatted.

If you’re getting this error when trying to preview a certificate from the studio, based on this code, you might’ve misconfigured either certificate date override or course certificate available date.