From ff957683e37078db49a415bd978d32c37b5353bd Mon Sep 17 00:00:00 2001 From: Eemeli Aro Date: Wed, 18 Dec 2024 16:51:06 +0200 Subject: [PATCH] Use locale's total_strings for GET //parts/ --- pontoon/base/models/locale.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pontoon/base/models/locale.py b/pontoon/base/models/locale.py index ac12a8568d..cb5d8914ac 100644 --- a/pontoon/base/models/locale.py +++ b/pontoon/base/models/locale.py @@ -390,6 +390,7 @@ def stats(self): { "title": "all-resources", "resource__path": [], + # FIXME rename as total_strings "resource__total_strings": self.total_strings, "pretranslated_strings": self.pretranslated_strings, "strings_with_errors": self.strings_with_errors, @@ -409,6 +410,7 @@ def get_details(parts): "title", "resource__path", "resource__deadline", + # FIXME rename as total_strings "resource__total_strings", "pretranslated_strings", "strings_with_errors", @@ -421,7 +423,12 @@ def get_details(parts): resource__project=project, resource__entities__obsolete=False, locale=self ).distinct() details = list( - get_details(translatedresources.annotate(title=F("resource__path"))) + get_details( + translatedresources.annotate( + resource__total_strings=F("total_strings"), + title=F("resource__path"), + ) + ) ) all_resources = ProjectLocale.objects.get(project=project, locale=self) @@ -430,6 +437,7 @@ def get_details(parts): "title": "all-resources", "resource__path": [], "resource__deadline": [], + # FIXME rename as total_strings "resource__total_strings": all_resources.total_strings, "pretranslated_strings": all_resources.pretranslated_strings, "strings_with_errors": all_resources.strings_with_errors,