# HG changeset patch # User neko259 # Date 2017-12-17 14:58:14 # Node ID 3563d624d04cd938ab058f35533b736f451f418a # Parent 227641ed5effd17318f107158276641fae5142fb Little simplifying for loading last posts diff --git a/boards/abstracts/settingsmanager.py b/boards/abstracts/settingsmanager.py --- a/boards/abstracts/settingsmanager.py +++ b/boards/abstracts/settingsmanager.py @@ -180,7 +180,7 @@ class SettingsManager: def get_last_posts(self): post_ids = self.get_setting(SETTING_LAST_POSTS) or [] - return [boards.models.Post.objects.get(id=post_id) for post_id in post_ids] + return list(boards.models.Post.objects.filter(id__in=post_ids)) class SessionSettingsManager(SettingsManager):