Skip to content

Commit

Permalink
parse entries
Browse files Browse the repository at this point in the history
  • Loading branch information
nulinspiratie committed Jul 11, 2024
1 parent f6e47e5 commit 34a4cf4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions backend/qualibrate_app/api/routes/snapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ def update_entity(
value: Any,
settings: Annotated[QualibrateSettings, Depends(get_settings)],
) -> bool:
if isinstance(value, str):
if value.isdigit():
value = int(value)
elif value.lower() in ["true", "false"]:
value = value.lower() == "true"
elif value.isnumeric():
value = float(value)
updated = snapshot.update_entry({data_path: value})
if updated:
requests.post(
Expand Down

0 comments on commit 34a4cf4

Please sign in to comment.