Skip to content

Commit 8a60abd

Browse files
authored
Fix report validation (#226)
1 parent 28a55a2 commit 8a60abd

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

gramps_webapi/api/resources/reports.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def validate_options(report: Dict, report_options: Dict, allow_file: bool = Fals
161161
abort(422)
162162
if "A number" in report["options_help"][option][2]:
163163
try:
164-
int(report_options[option])
164+
float(report_options[option])
165165
except ValueError:
166166
abort(422)
167167
if "Size in cm" in report["options_help"][option][2]:
@@ -197,10 +197,7 @@ class ReportFileResource(ProtectedResource, GrampsJSONEncoder):
197197
"""Report file resource."""
198198

199199
@use_args(
200-
{
201-
"options": fields.Str(validate=validate.Length(min=1)),
202-
},
203-
location="query",
200+
{"options": fields.Str(validate=validate.Length(min=1)),}, location="query",
204201
)
205202
def get(self, args: Dict, report_id: str) -> Response:
206203
"""Get specific report attributes."""

0 commit comments

Comments
 (0)