-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8884 from adityahase/fix-prepared-report-private-12
fix(security): Make all Prepared Report file attachments private
- Loading branch information
Showing
3 changed files
with
13 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
frappe/patches/v11_0/make_all_prepared_report_attachments_private.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from __future__ import unicode_literals | ||
import frappe | ||
|
||
|
||
def execute(): | ||
files = frappe.get_all("File", filters={"attached_to_doctype": "Prepared Report", "is_private": 0}) | ||
for file_name in files: | ||
file_doc = frappe.get_doc("File", file_name) | ||
file_doc.is_private = 1 | ||
file_doc.save() |