File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -253,6 +253,9 @@ def exclude_by_products(self, products: Iterable[AbstractProduct]):
253
253
.distinct ()
254
254
)
255
255
256
+ # @todo #SE747:30m Rm `get_group_tags_pairs`.
257
+ # Use `get_grouped_tags -> Dict[Group, List[Tag]]` instead.
258
+ # Tags pairs already lead us to errors with groups order.
256
259
def get_group_tags_pairs (self ) -> List [Tuple [TagGroup , List ['Tag' ]]]:
257
260
"""
258
261
Return set of group_tag pairs with specific properties.
@@ -279,7 +282,12 @@ def has_only_int_keys(tags: list):
279
282
return False
280
283
return True
281
284
282
- grouped_tags = groupby (self .prefetch_related ('group' ), key = attrgetter ('group' ))
285
+ grouped_tags = groupby (
286
+ self
287
+ .prefetch_related ('group' )
288
+ .order_by ('group__position' , 'group__name' ),
289
+ key = attrgetter ('group' )
290
+ )
283
291
result = []
284
292
for group , tags_ in grouped_tags :
285
293
tags_ = list (tags_ )
You can’t perform that action at this time.
0 commit comments