| # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors |
| # License: GNU General Public License v3. See license.txt |
| from __future__ import unicode_literals |
| from frappe.utils import today |
| def get_context(context): |
| doc = frappe.get_doc("Issue", frappe.form_dict.name) |
| if doc.raised_by == frappe.session.user: |
| ticket_context = {"title": "Not Allowed", "doc": {}} |
| def add_reply(ticket, message): |
| raise frappe.throw(_("Please write something")) |
| doc = frappe.get_doc("Issue", ticket) |
| if doc.raised_by != frappe.session.user: |
| raise frappe.throw(_("You are not allowed to reply to this ticket."), frappe.PermissionError) |
| "doctype":"Communication", |
| "sent_or_received": "Received" |
| comm.insert(ignore_permissions=True) |