def deleteFolder(folderId,foldername): userId = RetrieveSessionDetails('userId') currentFolderId = RetrieveSessionDetails('currentFolderId') flag = BusinessLayer.RemoveExisitngFolder(userId,currentFolderId,folderId,foldername) AddToSession('TotalSize',BusinessLayer.getTotalSize(userId)) return redirect(url_for('index',folderId = currentFolderId))
def deleteFolder(folderId, foldername): userId = RetrieveSessionDetails('userId') currentFolderId = RetrieveSessionDetails('currentFolderId') path = BusinessLayer.getPathForFolder(userId, folderId) flag = BusinessLayer.RemoveExisitngFolder(userId, currentFolderId, folderId, foldername) if flag == 1: target = os.path.join(APP_STORAGE_PATH, path) print("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa target: ", target) shutil.rmtree(target) AddToSession('TotalSize', BusinessLayer.getTotalSize(userId)) AddToSession('TotalSize', BusinessLayer.getTotalSize(userId)) return redirect(url_for('index', folderId=currentFolderId))