Rushabh Mehta | 156ce60 | 2015-09-11 18:49:59 +0530 | [diff] [blame] | 1 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors |
| 2 | # License: GNU General Public License v3. See license.txt |
| 3 | |
| 4 | from __future__ import unicode_literals |
| 5 | import frappe |
| 6 | |
| 7 | from frappe import _ |
| 8 | |
| 9 | def get_context(context): |
| 10 | context.no_cache = 1 |
| 11 | context.doc = frappe.get_doc(frappe.form_dict.doctype, frappe.form_dict.name) |
Rushabh Mehta | 3d76686 | 2015-09-16 18:52:52 +0530 | [diff] [blame] | 12 | if hasattr(context.doc, "set_indicator"): |
| 13 | context.doc.set_indicator() |
| 14 | |
Rushabh Mehta | 156ce60 | 2015-09-11 18:49:59 +0530 | [diff] [blame] | 15 | context.parents = frappe.form_dict.parents |
| 16 | |
Anand Doshi | 199d8a4 | 2015-09-28 19:04:42 +0530 | [diff] [blame] | 17 | if not context.doc.has_website_permission("read"): |
Rushabh Mehta | 156ce60 | 2015-09-11 18:49:59 +0530 | [diff] [blame] | 18 | frappe.throw(_("Not Permitted"), frappe.PermissionError) |