Control: sort sales-channels desc

This commit is contained in:
Richard Schreiber
2023-11-08 12:27:26 +01:00
parent 9b77403796
commit 13ee2b3c5d

View File

@@ -103,15 +103,15 @@ def get_all_sales_channels():
if _ALL_CHANNELS:
return _ALL_CHANNELS
types = OrderedDict()
channels = []
for recv, ret in register_sales_channels.send(None):
if isinstance(ret, (list, tuple)):
for r in ret:
types[r.identifier] = r
channels += ret
else:
types[ret.identifier] = ret
_ALL_CHANNELS = types
return types
channels.append(ret)
channels.sort(key=lambda c: c.identifier, reverse=True)
_ALL_CHANNELS = OrderedDict([(c.identifier, c) for c in channels])
return _ALL_CHANNELS
class WebshopSalesChannel(SalesChannel):