feat: Add redirect page
This commit is contained in:
parent
1987994310
commit
5318697c0f
1 changed files with 16 additions and 0 deletions
16
frappe/website/page_controllers/redirect_page.py
Normal file
16
frappe/website/page_controllers/redirect_page.py
Normal 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"
|
||||
})
|
||||
Loading…
Add table
Reference in a new issue