From cb1170153dc9303d1e92ee470e8e0178807faac7 Mon Sep 17 00:00:00 2001 From: kshtiijrajsharma Date: Tue, 3 Oct 2023 22:59:05 +0545 Subject: [PATCH] Fixes task id null problem --- backend/core/tasks.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/core/tasks.py b/backend/core/tasks.py index 0ebf7c1d..b15c2475 100644 --- a/backend/core/tasks.py +++ b/backend/core/tasks.py @@ -57,7 +57,9 @@ def train_model( try: ## -----------IMAGE DOWNLOADER--------- os.makedirs(settings.LOG_PATH, exist_ok=True) - + if training_instance.task_id is None or training_instance.task_id.strip() == '': + training_instance.task_id=train_model.request.id + training_instance.save() log_file = os.path.join( settings.LOG_PATH, f"run_{train_model.request.id}_log.txt" )