Skip to content

Commit

Permalink
fix(get_form_variables): flask.abort() request
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienChampagnol committed Jul 28, 2023
1 parent 48f4cef commit 18f9709
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
8 changes: 7 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "hatchling.build"

[project]
name = "OpenGeodeWeb-Back"
version = "0.0.2"
version = "0.0.1"
authors = [
{ name="Geode-solutions", email="[email protected]" },
]
Expand All @@ -26,3 +26,9 @@ dynamic = ["dependencies"]

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}

[tool.semantic_release]
version_variable = "pyproject.toml:version"
version_source = "commit"
branch = "next"
prerelease_tag = "rc"
19 changes: 15 additions & 4 deletions src/OpenGeodeWeb-Back/geode_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,18 +148,29 @@ def load(file_path):
return geode_objects.objects_list()[geode_object]["load"](file_path)


def save(data, geode_object, id, filename):
def save(data, geode_object, folder, filename):
geode_objects.objects_list()[geode_object]["save"](
data, os.path.join(UPLOAD_FOLDER, filename)
data, os.path.join(folder, filename)
)


def save_viewable(data, geode_object, id):
def save_viewable(data, geode_object, folder, id):
geode_objects.objects_list()[geode_object]["save_viewable"](
data, os.path.join(UPLOAD_FOLDER, id)
data, os.path.join(folder, id)
)


def get_form_variables(form, variables_array):
variables_dict = {}

for variable in variables_array:
if form.get(variable) is None:
flask.abort(400, f"No {variable} sent")
else:
variables_dict[variable] = form.get(variable)
return variables_dict


def get_geographic_coordinate_systems(geode_object):
if is_3D(geode_object):
return og_gs.GeographicCoordinateSystem3D.geographic_coordinate_systems()
Expand Down

0 comments on commit 18f9709

Please sign in to comment.