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

fixed minor bug for calculating word_diff #975

Merged
merged 1 commit into from
Jan 22, 2025
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
8 changes: 4 additions & 4 deletions backend/project/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ def get_reports_for_users(pk, start, end):
transcript__status="TRANSCRIPTION_EDIT_COMPLETE",
transcript__task__user__email=elem["mail"],
).values_list("transcript__video", "transcript__payload")
transcription_complete_payloads = {video_id: payload["payload"] for video_id, payload in user_transcription_complete_payloads}
transcription_complete_payloads = {video_id: payload["payload"] for video_id, payload in user_transcription_complete_payloads if "payload" in payload}
user_transcription_selectsource_payloads = User.objects.filter(
transcript__video__project_id__id=pk,
transcript__status="TRANSCRIPTION_SELECT_SOURCE",
transcript__task__user__email=elem["mail"],
).values_list("transcript__video", "transcript__payload")
transcription_selectsource_payloads = {video_id: payload["payload"] for video_id, payload in user_transcription_selectsource_payloads}
transcription_selectsource_payloads = {video_id: payload["payload"] for video_id, payload in user_transcription_selectsource_payloads if "payload" in payload}

transcript_word_diff = 0
for video_id, payload1 in transcription_complete_payloads.items():
Expand Down Expand Up @@ -160,13 +160,13 @@ def get_reports_for_users(pk, start, end):
translation__status="TRANSLATION_EDIT_COMPLETE",
translation__task__user__email=elem["mail"],
).values_list("translation__video", "translation__payload")
translation_complete_payloads = {video_id: payload["payload"] for video_id, payload in user_translation_complete_payloads}
translation_complete_payloads = {video_id: payload["payload"] for video_id, payload in user_translation_complete_payloads if "payload" in payload}
user_translation_selectsource_payloads = User.objects.filter(
translation__video__project_id__id=pk,
translation__status="TRANSLATION_SELECT_SOURCE",
translation__task__user__email=elem["mail"],
).values_list("translation__video", "translation__payload")
translation_selectsource_payloads = {video_id: payload["payload"] for video_id, payload in user_translation_selectsource_payloads}
translation_selectsource_payloads = {video_id: payload["payload"] for video_id, payload in user_translation_selectsource_payloads if "payload" in payload}

translation_word_diff = 0
for video_id, payload1 in translation_complete_payloads.items():
Expand Down
Loading