From 85e36328f7bd5033efaa92c3b040769eb2eee181 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Fri, 13 Sep 2019 15:27:37 +0100 Subject: Assign new tasks on the fly The old logic assigned a task when the user finished the demo, logged in, or finished an annotation. This was not optimal as it could lead to race conditions where some datasets were annotated unnecessarily. With this change we select the dataset to annotate at the exact moment the user wants to do another one. --- app/main/demo.py | 8 -------- 1 file changed, 8 deletions(-) (limited to 'app/main/demo.py') diff --git a/app/main/demo.py b/app/main/demo.py index bc9e7bd..3be8258 100644 --- a/app/main/demo.py +++ b/app/main/demo.py @@ -23,7 +23,6 @@ from app.main import bp from app.main.forms import NextForm from app.main.routes import RUBRIC from app.utils.datasets import load_data_for_chart, get_demo_true_cps -from app.utils.tasks import generate_user_task LOGGER = logging.getLogger(__name__) @@ -381,13 +380,6 @@ def redirect_user(demo_id, phase_id): current_user.is_introduced = True db.session.commit() - # assign a task to the user - task = generate_user_task(current_user) - if task is None: - return redirect(url_for("main.index")) - db.session.add(task) - db.session.commit() - return redirect(url_for("main.index")) elif phase_id == demo_last_phase_id: demo_id += 1 -- cgit v1.2.3