Remove unused code

This commit is contained in:
Yohan Boniface 2023-03-01 19:13:45 +01:00
parent b55b5504d7
commit 83ca957263

View file

@ -23,9 +23,8 @@ from django.http import (
)
from django.middleware.gzip import re_accepts_gzip
from django.shortcuts import get_object_or_404
from django.template.loader import render_to_string
from django.urls import reverse, reverse_lazy
from django.utils.encoding import force_bytes, smart_bytes
from django.utils.encoding import smart_bytes
from django.utils.http import http_date
from django.utils.translation import gettext as _
from django.utils.translation import to_locale
@ -329,15 +328,6 @@ def _urls_for_js(urls=None):
return urls
def render_to_json(templates, context, request):
"""
Generate a JSON HttpResponse with rendered template HTML.
"""
html = render_to_string(templates, context=context, request=request)
_json = json.dumps({"html": html})
return HttpResponse(_json)
def simple_json_response(**kwargs):
return HttpResponse(json.dumps(kwargs))