def _send_error(kong_site, test, content):
    real_site = Site.objects.get_current()
    message = render_to_string('kong/failed_email.txt', {'kong_site': kong_site,
                                                         'test': test,
                                                         'error': content,
                                                         'real_site': real_site})
    if getattr(settings, 'KONG_MAIL_MANAGERS', False):
        mail_managers('Kong Test Failed: %s (%s)' % (test, kong_site), message)
    if getattr(settings, 'KONG_MAIL_ADMINS', False):
        mail_admins('Kong Test Failed: %s (%s)' % (test, kong_site), message)
dataset/ETHPy150Open ericholscher/django-kong/kong/utils.py/_send_error/original