diff options
Diffstat (limited to 'app/main/routes.py')
| -rw-r--r-- | app/main/routes.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/main/routes.py b/app/main/routes.py index 85e8144..b961b60 100644 --- a/app/main/routes.py +++ b/app/main/routes.py @@ -9,6 +9,7 @@ from flask_login import current_user from app import db from app.decorators import login_required from app.main import bp +from app.main.email import send_annotation_backup from app.models import Annotation, Task from app.utils.datasets import load_data_for_chart from app.utils.tasks import generate_user_task @@ -84,6 +85,15 @@ def annotate(task_id): db.session.commit() flash("Your annotation has been recorded, thank you!", "success") + # send the annotation as email to the admin for backup + record = { + "user_id": task.annotator_id, + "dataset_id": task.dataset_id, + "task_id": task.id, + "annotations_raw": annotation, + } + send_annotation_backup(record) + # assign a new task if necessary task = generate_user_task(current_user) if task is None: |
