2929
3030routes = flask .Blueprint ("routes" , __name__ , url_prefix = "/opengeodeweb_back" )
3131
32-
3332routes .register_blueprint (
3433 blueprint_models .routes ,
3534 url_prefix = blueprint_models .routes .url_prefix ,
3837
3938schemas_dict = get_schemas_dict (os .path .join (os .path .dirname (__file__ ), "schemas" ))
4039
41-
4240@routes .route (
4341 schemas_dict ["allowed_files" ]["route" ],
4442 methods = schemas_dict ["allowed_files" ]["methods" ],
@@ -51,7 +49,6 @@ def allowed_files() -> flask.Response:
5149 extensions .add (extension )
5250 return flask .make_response ({"extensions" : list (extensions )}, 200 )
5351
54-
5552@routes .route (
5653 schemas_dict ["upload_file" ]["route" ],
5754 methods = schemas_dict ["upload_file" ]["methods" ],
@@ -66,7 +63,6 @@ def upload_file() -> flask.Response:
6663 file .save (os .path .join (UPLOAD_FOLDER , filename ))
6764 return flask .make_response ({"message" : "File uploaded" }, 201 )
6865
69-
7066@routes .route (
7167 schemas_dict ["allowed_objects" ]["route" ],
7268 methods = schemas_dict ["allowed_objects" ]["methods" ],
@@ -92,7 +88,6 @@ def allowed_objects() -> flask.Response:
9288 }
9389 return flask .make_response ({"allowed_objects" : allowed_objects }, 200 )
9490
95-
9691@routes .route (
9792 schemas_dict ["missing_files" ]["route" ],
9893 methods = schemas_dict ["missing_files" ]["methods" ],
@@ -131,7 +126,6 @@ def missing_files() -> flask.Response:
131126 200 ,
132127 )
133128
134-
135129@routes .route (
136130 schemas_dict ["geographic_coordinate_systems" ]["route" ],
137131 methods = schemas_dict ["geographic_coordinate_systems" ]["methods" ],
@@ -156,7 +150,6 @@ def crs_converter_geographic_coordinate_systems() -> flask.Response:
156150 crs_list .append (crs )
157151 return flask .make_response ({"crs_list" : crs_list }, 200 )
158152
159-
160153@routes .route (
161154 schemas_dict ["inspect_file" ]["route" ],
162155 methods = schemas_dict ["inspect_file" ]["methods" ],
@@ -174,7 +167,6 @@ def inspect_file() -> flask.Response:
174167 inspection_result = extract_inspector_result (inspection_data )
175168 return flask .make_response ({"inspection_result" : inspection_result }, 200 )
176169
177-
178170def extract_inspector_result (inspection_data : Any ) -> object :
179171 new_object = {}
180172
@@ -202,7 +194,6 @@ def extract_inspector_result(inspection_data: Any) -> object:
202194 new_object ["issues" ] = issues
203195 return new_object
204196
205-
206197@routes .route (
207198 schemas_dict ["geode_objects_and_output_extensions" ]["route" ],
208199 methods = schemas_dict ["geode_objects_and_output_extensions" ]["methods" ],
@@ -224,7 +215,6 @@ def geode_objects_and_output_extensions() -> flask.Response:
224215 200 ,
225216 )
226217
227-
228218@routes .route (
229219 schemas_dict ["save_viewable_file" ]["route" ],
230220 methods = schemas_dict ["save_viewable_file" ]["methods" ],
@@ -242,7 +232,6 @@ def save_viewable_file() -> flask.Response:
242232 200 ,
243233 )
244234
245-
246235@routes .route (
247236 schemas_dict ["texture_coordinates" ]["route" ],
248237 methods = schemas_dict ["texture_coordinates" ]["methods" ],
@@ -258,7 +247,6 @@ def texture_coordinates() -> flask.Response:
258247 texture_coordinates = geode_object .texture_manager ().texture_names ()
259248 return flask .make_response ({"texture_coordinates" : texture_coordinates }, 200 )
260249
261-
262250@routes .route (
263251 schemas_dict ["vertex_attribute_names" ]["route" ],
264252 methods = schemas_dict ["vertex_attribute_names" ]["methods" ],
@@ -279,7 +267,6 @@ def vertex_attribute_names() -> flask.Response:
279267 200 ,
280268 )
281269
282-
283270@routes .route (
284271 schemas_dict ["cell_attribute_names" ]["route" ],
285272 methods = schemas_dict ["cell_attribute_names" ]["methods" ],
@@ -300,7 +287,6 @@ def cell_attribute_names() -> flask.Response:
300287 200 ,
301288 )
302289
303-
304290@routes .route (
305291 schemas_dict ["polygon_attribute_names" ]["route" ],
306292 methods = schemas_dict ["polygon_attribute_names" ]["methods" ],
@@ -321,7 +307,6 @@ def polygon_attribute_names() -> flask.Response:
321307 200 ,
322308 )
323309
324-
325310@routes .route (
326311 schemas_dict ["polyhedron_attribute_names" ]["route" ],
327312 methods = schemas_dict ["polyhedron_attribute_names" ]["methods" ],
@@ -344,7 +329,6 @@ def polyhedron_attribute_names() -> flask.Response:
344329 200 ,
345330 )
346331
347-
348332@routes .route (
349333 schemas_dict ["ping" ]["route" ],
350334 methods = schemas_dict ["ping" ]["methods" ],
@@ -354,14 +338,12 @@ def ping() -> flask.Response:
354338 flask .current_app .config .update (LAST_PING_TIME = time .time ())
355339 return flask .make_response ({"message" : "Flask server is running" }, 200 )
356340
357-
358341@routes .route (schemas_dict ["kill" ]["route" ], methods = schemas_dict ["kill" ]["methods" ])
359342def kill () -> flask .Response :
360343 print ("Manual server kill, shutting down..." , flush = True )
361344 os ._exit (0 )
362345 return flask .make_response ({"message" : "Flask server is dead" }, 200 )
363346
364-
365347@routes .route (
366348 schemas_dict ["export_project" ]["route" ],
367349 methods = schemas_dict ["export_project" ]["methods" ],
@@ -381,6 +363,14 @@ def export_project() -> flask.Response:
381363 export_vease_path = os .path .join (project_folder , filename )
382364
383365 with get_session () as session :
366+ session .query (Data ).filter (
367+ (Data .input_file == None ) | (Data .input_file == "" )
368+ ).update (
369+ {Data .input_file : Data .native_file },
370+ synchronize_session = False
371+ )
372+ session .commit ()
373+
384374 rows = session .query (Data .id , Data .input_file , Data .additional_files ).all ()
385375
386376 with zipfile .ZipFile (
@@ -410,7 +400,6 @@ def export_project() -> flask.Response:
410400
411401 return utils_functions .send_file (project_folder , [export_vease_path ], filename )
412402
413-
414403@routes .route (
415404 schemas_dict ["import_project" ]["route" ],
416405 methods = schemas_dict ["import_project" ]["methods" ],
@@ -427,7 +416,6 @@ def import_project() -> flask.Response:
427416
428417 data_folder_path : str = flask .current_app .config ["DATA_FOLDER_PATH" ]
429418
430- # 423 Locked bypass : remove stopped requests
431419 if connection .scoped_session_registry :
432420 connection .scoped_session_registry .remove ()
433421 if connection .engine :
0 commit comments