Neil Trini Lasrado | 3f0a581 | 2016-07-19 14:17:33 +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 | def get_context(context): |
| 8 | announcement = frappe.get_doc('Announcement', frappe.form_dict.announcement) |
| 9 | context.no_cache = 1 |
| 10 | context.show_sidebar = True |
| 11 | announcement.has_permission('read') |
| 12 | context.doc = announcement |
| 13 | attachments = frappe.db.sql("""select file_url, file_name from tabFile as file |
| 14 | where file.attached_to_name=%s """,(announcement.name), as_dict = True) |
| 15 | |
| 16 | context.attached_files = attachments |
| 17 | |
| 18 | |