

def report_failure(self, item):
    item_dict = model_to_dict(item)
    url = settings.MY_EQUIPMENT_REPORT_FAILURE_URL
    if url:
        placeholders = [k[1] for k in Formatter().parse(url) if (k[1] is not None)]
        item_dict.update({k: getattr_dunder(item, k) for k in placeholders})
        if (self.request and ('username' not in item_dict)):
            item_dict['username'] = self.request.user.username

        def escape_param(p):
            '\n                Escape URL param and replace quotation by unicode inches sign\n                '
            return quote(str(p).replace('"', '″'))
        return '<a href="{}" target="_blank">{}</a><br />'.format(url.format(**{k: escape_param(v) for (k, v) in item_dict.items()}), _('Report failure'))
    return ''

dataset/ETHPy150Open allegro/ralph/src/ralph/accounts/admin.py AssetList.report_failure/original