Skip to content

Commit 1cab2bd

Browse files
hotfix : fixes count issue in offline prediction assignment
1 parent 35989e3 commit 1cab2bd

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

backend/core/tasks.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -614,11 +614,11 @@ def predict_area(prediction_request_id, folder=None):
614614
out,
615615
parent=s3_out_path,
616616
)
617-
inst.status, inst.finished_at, inst.result['count'] = (
618-
"FINISHED",
619-
timezone.now(),
620-
len(predictions["features"]),
621-
)
617+
inst.status = "FINISHED"
618+
inst.finished_at = timezone.now()
619+
if inst.result is None:
620+
inst.result = {}
621+
inst.result['count'] = len(predictions["features"])
622622
send_notification(inst, "Finished")
623623
inst.save()
624624
base_url = settings.API_BASE_URL + "/workspace/download/" + folder

0 commit comments

Comments
 (0)