[test-fix]

This commit is contained in:
Rushabh Mehta 2015-09-21 15:27:27 +05:30
parent bedf04a5f4
commit c8c2d4b170
2 changed files with 2 additions and 4 deletions

View file

@ -183,12 +183,10 @@ def move_file(file_list, new_parent, old_parent):
frappe.get_doc("File", old_parent).save()
frappe.get_doc("File", new_parent).save()
return "File(s) has been moved successfully!!"
def setup_folder_path(filename, new_parent):
file = frappe.get_doc("File", filename)
file.folder = new_parent
file.save()
if file.is_folder:
frappe.rename_doc("File", file.name, file.get_name_based_on_parent_folder())
frappe.rename_doc("File", file.name, file.get_name_based_on_parent_folder(), ignore_permissions=True)

View file

@ -97,7 +97,7 @@ def validate_rename(doctype, new, meta, merge, force, ignore_permissions):
if not (ignore_permissions or frappe.has_permission(doctype, "write")):
frappe.msgprint(_("You need write permission to rename"), raise_exception=1)
if not force and not meta.allow_rename:
if not (force or ignore_permissions) and not meta.allow_rename:
frappe.msgprint(_("{0} not allowed to be renamed").format(_(doctype)), raise_exception=1)
# validate naming like it's done in doc.py