templatetags: remove duplicate json_script tag
This commit is contained in:
parent
37d4b6be75
commit
417097b315
|
@ -821,20 +821,6 @@ def gnm_airquality_map(context):
|
|||
return context
|
||||
|
||||
|
||||
_json_script_escapes = {
|
||||
ord('>'): '\\u003E',
|
||||
ord('<'): '\\u003C',
|
||||
ord('&'): '\\u0026',
|
||||
}
|
||||
|
||||
|
||||
@register.filter(is_safe=True)
|
||||
def json_script(value, element_id):
|
||||
json_str = json.dumps(value, cls=DjangoJSONEncoder)
|
||||
json_str = json_str.replace('>', '\\u003E').replace('<', '\\u003C').replace('&', '\\u0026')
|
||||
return format_html('<script id="{}" type="application/json">{}</script>', element_id, mark_safe(json_str))
|
||||
|
||||
|
||||
@register.simple_tag
|
||||
def get_goto_cell(page, request):
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue