Skip to content

Commit

Permalink
Notifications: Sort the notifications in the preferences panel after …
Browse files Browse the repository at this point in the history
…translated title.
  • Loading branch information
thet committed Oct 30, 2023
1 parent 664c110 commit c488479
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/euphorie/client/browser/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,16 @@ def getContent(self):
@property
def all_notifications(self):
notifications = getAdapters((self.context, self.request), INotificationCategory)
for notification in notifications:
if not notification[1].available:
continue
yield notification[1]
# Return the available notifications, sorted by title.
notifications = [
notification[1]
for notification in notifications
if notification[1].available
]
return sorted(
notifications,
key=lambda notification: translate(notification.title),
)

@property
@memoize
Expand Down

0 comments on commit c488479

Please sign in to comment.