-
Notifications
You must be signed in to change notification settings - Fork 2
[utils]受入/検査がスキップされたタスク履歴番号を取得するメソッドを追加 #108
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
受入側だけ見ましたが、多分検査も同様かと。
index_list.append(index) | ||
else: | ||
# 直後の履歴がない | ||
index_list.append(index) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
最後の履歴が受入フェーズで担当者なしというのは、受入未着手も含まれるのでは?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
「受入フェーズで担当者なし」のタスクは、受入フェーズのタスク履歴がなかったため、問題ないかと思います。
「受入フェーズの担当者が割り当てられた」タスクは、受入フェーズのタスク履歴がありました。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
とはいえ、「started_datetimeと
ended_datetime`の両方がnullである」という条件を加えた方が確実だと思ったので、修正します。
annofabapi/utils.py
Outdated
""" | ||
index_list = [] | ||
for index, history in enumerate(task_history_list): | ||
if not (TaskPhase(history["phase"]) == TaskPhase.ACCEPTANCE and history["account_id"] is None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
作業時間が0であることも確認した方がよいのでは。ないと困る一例として、受入後のアノテーション一括編集とかがあります。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
メモ:受入完了状態のタスクに対してアノテーション一括編集すると、
- 受入フェーズが追加される
- 担当者はなし
- 作業時間は0でない
になる
annofabapi/utils.py
Outdated
if index + 1 < len(task_history_list): | ||
# 直後の履歴あり | ||
next_history = task_history_list[index + 1] | ||
# 直後の履歴が受入の場合、受入がスキップされた履歴(提出取り消しではない) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
個人的な感想ですが、この説明の正しさを理解するのに少し時間がかかりました。
「直後が受入であること」ではなく「直後が前段のフェーズでないこと」とした方が、確かに提出取消ならそうなるはずだ、と理解しやすいのではないでしょうか。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
「直後が受入であること」ではなく「直後が前段のフェーズでないこと」とした方が、確かに提出取消ならそうなるはずだ、と理解しやすいのではないでしょうか。
「前段≠直前」で合っていますか?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
close #107