Skip to content

Commit 10d26c4

Browse files
committed
[Bug] Convert start and end time to float for saving
1 parent 0a2250e commit 10d26c4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

backend/routes/data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ def add_data():
169169
new_segment = generate_segmentation(
170170
data_id=data.id,
171171
project_id=project.id,
172-
end_time=segment["end_time"],
173-
start_time=segment["start_time"],
172+
end_time=float(segment["end_time"]),
173+
start_time=float(segment["start_time"]),
174174
annotations=segment.get("annotations", {}),
175175
transcription=segment["transcription"],
176176
)

backend/routes/projects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ def add_segmentations(project_id, data_id, segmentation_id=None):
538538
if not (isinstance(start_time, (int, float)) or isinstance(end_time, (int, float))):
539539
return (
540540
jsonify(
541-
message="Params `start_time` and `end_time` need to be float values"
541+
message="Params `start_time` and `end_time` need to be float or int values"
542542
),
543543
400,
544544
)

0 commit comments

Comments
 (0)