Stats not calculated properly for translations with warning

RESOLVED FIXED

Status

defect
P2
normal
RESOLVED FIXED
6 months ago
6 months ago

People

(Reporter: mathjazz, Assigned: mathjazz)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

Steps to reproduce:

  1. Open a string with an approved translation.
  2. Override the translation with a new one that has a c-l or pontoon warning.

Expected result: stats show an increase in warnings and decrease in approved strings.

Actual result: stats are unchanged.

--

The bug is in Entity.get_stats() method, which returns the same result for both, stats_before and stats_after:

{u'strings_with_errors_diff': 0, u'fuzzy_strings_diff': 0, u'strings_with_warnings_diff': 0, u'total_strings_diff': 0, u'unreviewed_strings_diff': 0, u'approved_strings_diff': 1}

Summary: Translations with warning → Stats not calculated properly for translations with warning
Assignee: nobody → m
Status: NEW → ASSIGNED
Commit pushed to master at https://github.com/mozilla/pontoon

https://github.com/mozilla/pontoon/commit/2d46b88671f6f61464c43177d908663eb2fe5d5d
Fix bug 1521606: Save Errors/Warnings in Translation.save() (#1179)

Saving failed checks must happen before updating stats in Entity.get_stats_diff().
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.