I cannot view Certificate

I recently upgraded from Tutor 14 to 15
and applied a custom theme. While the theme works, the certificates page fails to load, displaying a “500 error” with the message:

https://domain/certificates/61ba2a11bf38413e858b640e32c57220

“There has been a 500 error on the web name servers. Please wait a few seconds and reload the page.”

and preview certificate with the message:

The log shows an error related to certificates not rendering correctly.

Internal Server Error: /certificates/61ba2a11bf38413e858b640e32c57220

I’ve seen this kind of error when upgrading the templates. The mako errors are a bit harder to figure out in the stack trace but what that message is:

In your theme, either you included acomplisment-base.html or a file that is importing it when you wrote the theme.
The error is saying that it does not find the “js_escaped_string” function. It is trying to call a variable that is not defined.

You need to upgrade your templates to properly import the function.

from openedx.core.djangolib.js_utils import js_escaped_string