Skip to content

Commit

Permalink
FIX issue #19, duplicated file names were using same S3 key and overr…
Browse files Browse the repository at this point in the history
…iden. Solved including file id within key
  • Loading branch information
developmentforpeople committed Mar 3, 2024
1 parent b7554d9 commit 7c67df1
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -373,8 +373,11 @@ def dfp_external_storage_upload_file(self, local_file=None, delete_file=True):

# TODO: MOSTRAR MENSAJE DE SUBIENDO ARCHIVO Y CERRARLO O MOSTRAR ARCHIVO SUBIDO AL FINAL DE ESTE MÉTODO

# Define S3 key
# key = f"{frappe.local.site}/{self.file_name}" # << Before 2024.03.03
base, extension = os.path.splitext(self.file_name)
key = f"{frappe.local.site}/{base}-{self.name}{extension}"

is_public = "/public" if not self.is_private else ""
if not local_file:
local_file = "./" + frappe.local.site + is_public + self.file_url
Expand Down

0 comments on commit 7c67df1

Please sign in to comment.