Compare commits

...

3 Commits

Author SHA1 Message Date
Raphael Michel
8957ed929a Update src/pretix/base/channels.py 2023-11-09 10:09:07 +01:00
Richard Schreiber
a24a36b1e7 sort asc, force web first 2023-11-08 12:29:18 +01:00
Richard Schreiber
13ee2b3c5d Control: sort sales-channels desc 2023-11-08 12:27:26 +01:00

View File

@@ -103,15 +103,17 @@ 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)
_ALL_CHANNELS = OrderedDict([(c.identifier, c) for c in channels])
if 'web' in _ALL_CHANNELS:
_ALL_CHANNELS.move_to_end('web', last=False)
return _ALL_CHANNELS
class WebshopSalesChannel(SalesChannel):