fix(print): Check doc permission before checking related info

This commit is contained in:
Gavin D'souza 2022-11-29 17:47:45 +05:30
parent d78b967f8d
commit cff0567faf

View file

@ -288,6 +288,8 @@ def get_html_and_style(
else:
document = frappe.get_doc(json.loads(doc))
document.check_permission()
print_format = get_print_format_doc(print_format, meta=document.meta)
set_link_titles(document)
@ -317,6 +319,8 @@ def get_rendered_raw_commands(doc: str, name: str = None, print_format: str = No
else:
document = frappe.get_doc(json.loads(doc))
document.check_permission()
print_format = get_print_format_doc(print_format, meta=document.meta)
if not print_format or (print_format and not print_format.raw_printing):