def _format_value(self, key, value): if value: try: return strip_tags(str(value)) except (TypeError, ValueError): pass