Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor bugfix #791

Merged
merged 3 commits into from
Jul 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 10 additions & 46 deletions backend/tasks/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1299,17 +1299,7 @@ def partial_update(self, request, pk=None):
update_annotated_at = (
True
if annotation_status == LABELED
and (
annotation_obj.annotation_status == UNLABELED
or (
(
annotation_obj.annotation_status == DRAFT
or annotation_obj.annotation_status == SKIPPED
)
and annotation_obj.task.revision_loop_count["review_count"]
== 0
)
)
and annotation_obj.annotated_at is None
else False
)

Expand Down Expand Up @@ -1397,21 +1387,7 @@ def partial_update(self, request, pk=None):
ACCEPTED_WITH_MINOR_CHANGES,
ACCEPTED_WITH_MAJOR_CHANGES,
]
and (
annotation_obj.annotation_status == UNREVIEWED
or (
(
annotation_obj.annotation_status == DRAFT
or annotation_obj.annotation_status == SKIPPED
)
and annotation_obj.task.revision_loop_count["review_count"]
== 0
and annotation_obj.task.revision_loop_count[
"super_check_count"
]
== 0
)
)
and annotation_obj.annotated_at is None
else False
)

Expand Down Expand Up @@ -1446,9 +1422,9 @@ def partial_update(self, request, pk=None):
if auto_save:
update_fields_list = ["result", "lead_time"]
annotation_obj.result = request.data["result"]
if "annotation_notes" in dict(request.data):
annotation_obj.annotation_notes = request.data["annotation_notes"]
update_fields_list.append("annotation_notes")
if "review_notes" in dict(request.data):
annotation_obj.review_notes = request.data["review_notes"]
update_fields_list.append("review_notes")
annotation_obj.lead_time = request.data["lead_time"]
annotation_obj.save(update_fields=update_fields_list)
annotation_response = Response(
Expand Down Expand Up @@ -1545,24 +1521,12 @@ def partial_update(self, request, pk=None):
supercheck_status = request.data["annotation_status"]
update_annotated_at = (
True
if review_status
if supercheck_status
in [
VALIDATED,
VALIDATED_WITH_CHANGES,
]
and (
annotation_obj.annotation_status == UNREVIEWED
or (
(
annotation_obj.annotation_status == DRAFT
or annotation_obj.annotation_status == SKIPPED
)
and annotation_obj.task.revision_loop_count[
"super_check_count"
]
== 0
)
)
and annotation_obj.annotated_at is None
else False
)
else:
Expand Down Expand Up @@ -1597,9 +1561,9 @@ def partial_update(self, request, pk=None):
if auto_save:
update_fields_list = ["result", "lead_time"]
annotation_obj.result = request.data["result"]
if "annotation_notes" in dict(request.data):
annotation_obj.annotation_notes = request.data["annotation_notes"]
update_fields_list.append("annotation_notes")
if "supercheck_notes" in dict(request.data):
annotation_obj.supercheck_notes = request.data["supercheck_notes"]
update_fields_list.append("supercheck_notes")
annotation_obj.lead_time = request.data["lead_time"]
annotation_obj.save(update_fields=update_fields_list)
annotation_response = Response(
Expand Down
Loading