From ff34bf6c77b56483e7ad00efc8d755288249d702 Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Wed, 25 Jun 2014 12:07:33 +0530 Subject: [PATCH] hotfix get_file_url --- frappe/public/js/frappe/form/attachments.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frappe/public/js/frappe/form/attachments.js b/frappe/public/js/frappe/form/attachments.js index de1204aa53..c292416fa3 100644 --- a/frappe/public/js/frappe/form/attachments.js +++ b/frappe/public/js/frappe/form/attachments.js @@ -99,7 +99,12 @@ frappe.ui.form.Attachments = Class.extend({ get_file_url: function(attachment) { var file_url = attachment.file_url; if (!file_url) { - file_url = '/files/' + attachment.file_name; + if (attachment.file_name.indexOf('files/') === 0) { + file_url = '/' + attachment.file_name; + } + else { + file_url = '/files/' + attachment.file_name; + } } return encodeURI(file_url); },