aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/main/routes.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/main/routes.py b/app/main/routes.py
index 7e9505a..1495e35 100644
--- a/app/main/routes.py
+++ b/app/main/routes.py
@@ -86,8 +86,15 @@ def task(task_id):
task = Task.query.filter_by(id=task_id).first()
if task is None:
- flash("No task with id %r has been assigned to you." % task_id,
- "error")
+ flash("No task with id %r exists." % task_id, "error")
+ return redirect(url_for("main.index"))
+ if not task.annotator_id == current_user.id:
+ flash(
+ "No task with id %r has been assigned to you." % task_id, "error"
+ )
+ return redirect(url_for("main.index"))
+ if task.done:
+ flash("It's not possible to edit annotations at the moment.")
return redirect(url_for("main.index"))
data = load_data_for_chart(task.dataset.name)
return render_template(