def message_to_html(message):
    def decoder(ref):
        obj, msgid = decode_object(ref)
        if hasattr(obj, "get_absolute_url"): # don't fail silenty if get_absolute_url hasn't been defined
            return u"""<a href="%s">%s</a>""" % (obj.get_absolute_url(), unicode(obj)), msgid
        else:
            return unicode(obj), msgid
    return decode_message(message, decoder)
dataset/ETHPy150Open brosner/django-notification/notification/message.py/message_to_html/original