feat: Add redirect page

This commit is contained in:
Suraj Shetty 2021-05-18 08:40:37 +05:30
parent 1987994310
commit 5318697c0f

View file

@ -0,0 +1,16 @@
import frappe
from frappe.website.render import build_response
class RedirectPage(object):
def __init__(self, path, http_status_code=301):
self.path = path
self.http_status_code = http_status_code
def validate(self):
return True
def render(self):
return build_response(self.path, "", 301, {
"Location": frappe.flags.redirect_location or (frappe.local.response or {}).get('location'),
"Cache-Control": "no-store, no-cache, must-revalidate"
})