mirror of
https://github.com/pretix/pretix.git
synced 2026-05-10 16:04:02 +00:00
Keep sales-channels in same order (Z#23135800) (#3705)
* Control: sort sales-channels desc * sort asc, force web first * Update src/pretix/base/channels.py --------- Co-authored-by: Raphael Michel <michel@rami.io>
This commit is contained in:
committed by
GitHub
parent
5d28e5a959
commit
9dc1328b47
@@ -103,15 +103,17 @@ def get_all_sales_channels():
|
|||||||
if _ALL_CHANNELS:
|
if _ALL_CHANNELS:
|
||||||
return _ALL_CHANNELS
|
return _ALL_CHANNELS
|
||||||
|
|
||||||
types = OrderedDict()
|
channels = []
|
||||||
for recv, ret in register_sales_channels.send(None):
|
for recv, ret in register_sales_channels.send(None):
|
||||||
if isinstance(ret, (list, tuple)):
|
if isinstance(ret, (list, tuple)):
|
||||||
for r in ret:
|
channels += ret
|
||||||
types[r.identifier] = r
|
|
||||||
else:
|
else:
|
||||||
types[ret.identifier] = ret
|
channels.append(ret)
|
||||||
_ALL_CHANNELS = types
|
channels.sort(key=lambda c: c.identifier)
|
||||||
return types
|
_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):
|
class WebshopSalesChannel(SalesChannel):
|
||||||
|
|||||||
Reference in New Issue
Block a user