Selaa lähdekoodia

fix: Replace render() with get_response

version-14
Suraj Shetty 4 vuotta sitten
vanhempi
commit
e18a43e11d
2 muutettua tiedostoa jossa 5 lisäystä ja 5 poistoa
  1. +3
    -3
      frappe/app.py
  2. +2
    -2
      frappe/utils/response.py

+ 3
- 3
frappe/app.py Näytä tiedosto

@@ -20,6 +20,7 @@ import frappe.api
import frappe.utils.response
from frappe.utils import get_site_name, sanitize_html
from frappe.middlewares import StaticDataMiddleware
from frappe.website.serve import get_response
from frappe.utils.error import make_error_snapshot
from frappe.core.doctype.comment.comment import update_comments_in_parent_after_request
from frappe import _
@@ -73,7 +74,7 @@ def application(request):
response = frappe.utils.response.download_private_file(request.path)

elif request.method in ('GET', 'HEAD', 'POST'):
response = frappe.website.render.render()
response = get_response()

else:
raise NotFound
@@ -255,8 +256,7 @@ def handle_exception(e):
make_error_snapshot(e)

if return_as_message:
response = frappe.website.render.render("message",
http_status_code=http_status_code)
response = get_response("message", http_status_code=http_status_code)

return response



+ 2
- 2
frappe/utils/response.py Näytä tiedosto

@@ -149,8 +149,8 @@ def json_handler(obj):

def as_page():
"""print web page"""
from frappe.website.render import render
return render(frappe.response['route'], http_status_code=frappe.response.get("http_status_code"))
from frappe.website.serve import get_response
return get_response(frappe.response['route'], http_status_code=frappe.response.get("http_status_code"))

def redirect():
return werkzeug.utils.redirect(frappe.response.location)


Ladataan…
Peruuta
Tallenna