File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 7
7
from django .db .models import Sum
8
8
from django .db .models .manager import BaseManager
9
9
from django .utils import timezone
10
+ from django .utils .functional import cached_property
10
11
11
12
from pontoon .base .aggregated_stats import AggregatedStats
12
13
from pontoon .base .models .locale import Locale
@@ -231,6 +232,17 @@ class Meta:
231
232
def __str__ (self ):
232
233
return self .name
233
234
235
+ @cached_property
236
+ def unsynced_locales (self ):
237
+ """
238
+ Project Locales that haven't been synchronized yet.
239
+ """
240
+ return self .locales .exclude (
241
+ pk__in = Locale .objects .filter (
242
+ translatedresources__resource__project = self
243
+ ).values_list ("pk" , flat = True )
244
+ )
245
+
234
246
def serialize (self ):
235
247
return {
236
248
"pk" : self .pk ,
Original file line number Diff line number Diff line change @@ -99,6 +99,11 @@ def checkout_repos(
99
99
"""
100
100
source : Checkout | None = None
101
101
target : Checkout | None = None
102
+
103
+ # If the project using configuration file has unsynced locales, perform forced sync
104
+ if not force and project .configuration_file and project .unsynced_locales :
105
+ force = True
106
+
102
107
for repo in cast (BaseManager [Repository ], project .repositories ).all ():
103
108
if repo .source_repo :
104
109
if source :
You can’t perform that action at this time.
0 commit comments