From 154cee29a410b748f2c1401d367abce58af2e1bc Mon Sep 17 00:00:00 2001
From: Stefano Alberto Russo <stefano.russo@gmail.com>
Date: Fri, 8 Apr 2022 07:42:19 +0200
Subject: [PATCH] Fixed with a workaround a bug when uploading files an missing
 trailing slash on path.

---
 services/webapp/code/rosetta/core_app/api.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/services/webapp/code/rosetta/core_app/api.py b/services/webapp/code/rosetta/core_app/api.py
index 7901d79..c0373cc 100644
--- a/services/webapp/code/rosetta/core_app/api.py
+++ b/services/webapp/code/rosetta/core_app/api.py
@@ -1064,6 +1064,10 @@ class FileManagerAPI(PrivateGETAPI, PrivatePOSTAPI):
             # Set support vars
             storage = self.get_storage_from_path(path, request)
             path = '/'+'/'.join(path.split('/')[2:])
+            
+            # Bug workaround?
+            if not path.endswith('/'):
+                path += '/' 
 
             # Get the file upload
             file_upload = request.FILES['files']
-- 
GitLab