Fixed an issue where ERD Tool can't load the saved pgerd file from Shared Storage. #6558

This commit is contained in:
San Lin Naing 2023-07-13 14:36:46 +09:00 committed by GitHub
parent 715fa47eb6
commit 8dd8d1d03a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1864,9 +1864,18 @@ def load_file():
file_path = unquote(file_data['file_name'])
# get the current storage from request if available
# or get it from last_storage preference.
storage_folder = ''
if 'storage' in file_data:
storage_folder = file_data['storage']
else:
storage_folder = Preferences.module('file_manager').preference(
'last_storage').get()
# retrieve storage directory path
storage_manager_path = get_storage_directory(
shared_storage=file_data['storage'] if 'storage' in file_data else '')
shared_storage=storage_folder)
try:
Filemanager.check_access_permission(storage_manager_path, file_path)