Skip to content

Commit

Permalink
Cater for pages without pulication dates
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatcherK committed Nov 23, 2023
1 parent 7df9061 commit 56a7868
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions di_website/home/templatetags/content_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,5 @@
def get_featured_pages(page_blocks):
featured_pages = [block.value for block in page_blocks if block.value.live]
ordered_featured_pages = sorted(featured_pages, key=lambda x:
getattr(x.specific, 'publication_date',
None), reverse=True)
getattr(x.specific, 'publication_date',getattr(x.specific, 'first_published_at', None)), reverse=True)
return ordered_featured_pages

0 comments on commit 56a7868

Please sign in to comment.