Skip to content

Commit a36f4ba

Browse files
committed
^p
1 parent dd6af0e commit a36f4ba

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/opengeodeweb_back/routes/blueprint_routes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ def texture_coordinates():
308308
)
309309
def vertex_attribute_names():
310310
utils_functions.validate_request(flask.request, vertex_attribute_names_json)
311-
data = geode_functions.load_data(flask.request.json("id"))
311+
data = geode_functions.load_data(flask.request.json.get("id"))
312312
vertex_attribute_names = data.vertex_attribute_manager().attribute_names()
313313
return flask.make_response(
314314
{
@@ -331,7 +331,7 @@ def vertex_attribute_names():
331331
)
332332
def polygon_attribute_names():
333333
utils_functions.validate_request(flask.request, polygon_attribute_names_json)
334-
data = geode_functions.load_data(flask.request.json("id"))
334+
data = geode_functions.load_data(flask.request.json.get("id"))
335335
polygon_attribute_names = data.polygon_attribute_manager().attribute_names()
336336
return flask.make_response(
337337
{
@@ -354,7 +354,7 @@ def polygon_attribute_names():
354354
)
355355
def polyhedron_attribute_names():
356356
utils_functions.validate_request(flask.request, polyhedron_attribute_names_json)
357-
data = geode_functions.load_data(flask.request.json("id"))
357+
data = geode_functions.load_data(flask.request.json.get("id"))
358358
polyhedron_attribute_names = data.polyhedron_attribute_manager().attribute_names()
359359
return flask.make_response(
360360
{

src/opengeodeweb_back/routes/models/blueprint_models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def uuid_to_flat_index():
2020
utils_functions.validate_request(flask.request, vtm_component_indices_json)
2121

2222
vtm_file_path = geode_functions.data_file_path(
23-
flask.request.json("id"), "viewable.vtm"
23+
flask.request.json.get("id"), "viewable.vtm"
2424
)
2525
tree = ET.parse(vtm_file_path)
2626
root = tree.find("vtkMultiBlockDataSet")
@@ -49,6 +49,6 @@ def extract_model_uuids(model):
4949
@routes.route(mesh_components_json["route"], methods=mesh_components_json["methods"])
5050
def extract_uuids_endpoint():
5151
utils_functions.validate_request(flask.request, mesh_components_json)
52-
model = geode_functions.load_data(flask.request.json("id"))
52+
model = geode_functions.load_data(flask.request.json.get("id"))
5353
uuid_dict = extract_model_uuids(model)
5454
return flask.make_response({"uuid_dict": uuid_dict}, 200)

tests/test_routes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def get_full_data():
157157
assert type(native_file_name) is str
158158
viewable_file_name = response.json["viewable_file_name"]
159159
assert type(viewable_file_name) is str
160-
id = response.json("id")
160+
id = response.json.get("id")
161161
assert type(id) is str
162162
object_type = response.json["object_type"]
163163
assert type(object_type) is str
@@ -261,7 +261,7 @@ def test_create_point(client):
261261
assert response.status_code == 200
262262
viewable_file_name = response.json["viewable_file_name"]
263263
assert type(viewable_file_name) is str
264-
id = response.json("id")
264+
id = response.json.get("id")
265265
assert type(id) is str
266266

267267
# Test all params

0 commit comments

Comments
 (0)