blob: 4a61fc8ccc8c0d5e29e3c5f73019f560483b169c [file] [log] [blame]
Neil Trini Lasrado3f0a5812016-07-19 14:17:33 +05301# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
2# License: GNU General Public License v3. See license.txt
3
4from __future__ import unicode_literals
5import frappe
6
7def 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