Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,3 @@ werkzeug==3.1.8
# flask
# flask-cors

opengeodeweb-microservice==1.*,>=1.1.3
17 changes: 12 additions & 5 deletions src/opengeodeweb_back/routes/blueprint_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -547,10 +547,11 @@ def export_project() -> flask.Response:
for data_id, native_file in rows:
base_dir = os.path.join(project_folder, data_id)
if os.path.isdir(base_dir):
for f_name in os.listdir(base_dir):
file_path = os.path.join(base_dir, f_name)
if os.path.isfile(file_path):
zip_file.write(file_path, os.path.join(data_id, f_name))
for root, directories, files in os.walk(base_dir):
for file_name in files:
file_path = os.path.join(root, file_name)
relative_path = os.path.relpath(file_path, base_dir)
zip_file.write(file_path, os.path.join(data_id, relative_path))

zip_file.writestr("snapshot.json", flask.json.dumps(params.snapshot))

Expand Down Expand Up @@ -622,7 +623,13 @@ def import_project() -> flask.Response:
viewable_name = data.viewable_file
if viewable_name:
vpath = geode_functions.data_file_path(data.id, viewable_name)
if os.path.isfile(vpath):
viewable_dir = os.path.join(data_path, "viewable")
has_components = os.path.isdir(viewable_dir) and bool(
os.listdir(viewable_dir)
)
if os.path.isfile(vpath) and (
data.viewer_object != "model" or has_components
):
continue

native_file = str(data.native_file or "")
Expand Down
Loading