Created
July 26, 2017 18:11
-
-
Save mathjazz/157cfac33073306892c38039d45e7093 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/pontoon/base/views.py b/pontoon/base/views.py | |
| index dd503ad..15fc6ec 100755 | |
| --- a/pontoon/base/views.py | |
| +++ b/pontoon/base/views.py | |
| @@ -583,8 +583,9 @@ def update_translation(request): | |
| if len(translations) > 0: | |
| # Same translation exists | |
| - try: | |
| - t = translations.get(string=string) | |
| + same_translations = translations.filter(string=string).order_by('-approved', '-date') | |
| + if len(same_translations) > 0: | |
| + t = same_translations[0] | |
| # If added by privileged user, approve and unfuzzy it | |
| if can_translate: | |
| @@ -652,7 +653,7 @@ def update_translation(request): | |
| }) | |
| # Different translation added | |
| - except: | |
| + else: | |
| warnings = utils.quality_check(original, string, l, ignore) | |
| if warnings: | |
| return warnings |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment