0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-30 01:46:24 +01:00

Sort side panels by order

This commit is contained in:
Sage Abdullah 2022-07-01 19:07:34 +07:00 committed by Karl Hobley
parent 80643e0680
commit c6e6f46c29

View File

@ -142,12 +142,12 @@ class BaseSidePanels:
]
def __iter__(self):
return iter(self.side_panels)
return iter(sorted(self.side_panels, key=lambda p: p.order))
@cached_property
def media(self):
media = Media()
for panel in self.side_panels:
for panel in self:
media += panel.media
return media