Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def getpage():
- """
- Load the page from `webnotes.form` and send it via `webnotes.response`
- """
- page = webnotes.form_dict.get('name')
- doclist = get(page)
- if has_permission(doclist):
- # load translations
- if webnotes.lang != "en":
- from webnotes.modules import get_doc_path
- from webnotes.translate import get_lang_data
- d = doclist[0]
- messages_js = get_lang_data(get_doc_path(d.module, d.doctype, d.name),
- webnotes.lang, 'js')
- messages_py = get_lang_data(get_doc_path(d.module, d.doctype, d.name),
- webnotes.lang, 'py')
- messages = dict(messages_js,**messages_py)
- webnotes.response["__messages"] = messages
- webnotes.response['docs'] = doclist
- else:
- webnotes.response['403'] = 1
- raise webnotes.PermissionError, 'No read permission for Page %s' % \
- (doclist[0].title or page, )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement