You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If an "in-progress" annotation project is deleted, any active annotator users who are assigned to that project are left permanently ineligible to be assigned to any other projects.
To Reproduce
Steps to reproduce the behavior:
Create a project
Assign an annotator to that project
Delete the project
Attempt to assign the same annotator to a different project - they are not listed in the eligible annotators list
Expected behavior
Deleting a project should free up the annotators who were assigned to that project to be able to annotate other projects.
Additional context
The root cause of this problem appears to be that the foreign key constraints on AnnotatorProject are set to simply set the project field to NULL when the referenced Project is deleted, rather than deleting the whole AnnotatorProject assignment:
and thus not available to be assigned to any other project. When this happened to @iabufarha in production I had to delete the offending row from the backend_annotatorproject table directly in the database to unblock them.
Possible fixes
use on_delete=models.CASCADE so Teamware deletes all AnnotatorProject assignments for this project when the project is deleted, and/or
perform checks in rpc.delete_project and disallow deletion of a project that has active annotators. The manager would need to mark all annotators as "complete" or "rejected" before being allowed to delete the project.
The text was updated successfully, but these errors were encountered:
Describe the bug
If an "in-progress" annotation project is deleted, any active annotator users who are assigned to that project are left permanently ineligible to be assigned to any other projects.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Deleting a project should free up the annotators who were assigned to that project to be able to annotate other projects.
Additional context
The root cause of this problem appears to be that the foreign key constraints on
AnnotatorProject
are set to simply set theproject
field to NULL when the referencedProject
is deleted, rather than deleting the wholeAnnotatorProject
assignment:gate-teamware/backend/models.py
Lines 841 to 842 in 8b54bc1
This means that the user is not assigned to a project, but they are still considered as "active" in
rpc.get_possible_annotators
:gate-teamware/backend/rpc.py
Lines 715 to 719 in 8b54bc1
and thus not available to be assigned to any other project. When this happened to @iabufarha in production I had to delete the offending row from the
backend_annotatorproject
table directly in the database to unblock them.Possible fixes
on_delete=models.CASCADE
so Teamware deletes allAnnotatorProject
assignments for this project when the project is deleted, and/orrpc.delete_project
and disallow deletion of a project that has active annotators. The manager would need to mark all annotators as "complete" or "rejected" before being allowed to delete the project.The text was updated successfully, but these errors were encountered: