Skip to content

Commit

Permalink
Fix FeaturedPostsPlugin get_posts method rendering all posts instead …
Browse files Browse the repository at this point in the history
…of selected ones
  • Loading branch information
protoroto committed Dec 22, 2023
1 parent 25c6d74 commit bfbfd5b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions djangocms_blog/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,11 +611,10 @@ def copy_relations(self, oldinstance):
self.posts.set(oldinstance.posts.all())

def get_posts(self, request, published_only=True):
# if self.posts.exists():
# posts = self.post_queryset(request, published_only, selected_posts=self.posts.all())
# else:
# posts = self.post_queryset(request, published_only)
posts = self.post_queryset(request, published_only)
if self.posts.exists():
posts = self.post_queryset(request, published_only, selected_posts=self.posts.all())
else:
posts = self.post_queryset(request, published_only)

Check warning on line 617 in djangocms_blog/models.py

View check run for this annotation

Codecov / codecov/patch

djangocms_blog/models.py#L617

Added line #L617 was not covered by tests
return posts


Expand Down

0 comments on commit bfbfd5b

Please sign in to comment.