commit | ef313f51eedac844078157b24da3fcce059ccf11 | [log] [tgz] |
---|---|---|
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | Mon Jun 06 09:40:02 2022 +0200 |
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | Mon Jun 06 09:41:52 2022 +0200 |
tree | c4f376ba6f722ce0069ecb9302e281efa680bf41 | |
parent | f435e6610289cd298c9e5e5c22f30479a3ef646a [diff] |
KB66 NewsletterSender: Only consider top-level posts. Change-Id: I8a57dbdbad27e01297263b382ce557859d9b462d
diff --git a/src/main/java/eu/mulk/mulkcms2/benki/newsletter/NewsletterSender.java b/src/main/java/eu/mulk/mulkcms2/benki/newsletter/NewsletterSender.java index c6999fb..b8f2d07 100644 --- a/src/main/java/eu/mulk/mulkcms2/benki/newsletter/NewsletterSender.java +++ b/src/main/java/eu/mulk/mulkcms2/benki/newsletter/NewsletterSender.java
@@ -55,12 +55,14 @@ List<Post<?>> posts = Post.list( - "" - + "SELECT p FROM Post p" - + " JOIN p.targets r" - + " JOIN r.tags tag" - + " WHERE newsletter IS NULL" - + " AND tag = 'world'", + """ + SELECT DISTINCT p FROM Post p + JOIN p.targets r + JOIN r.tags tag + WHERE p.newsletter IS NULL + AND p.scope = 'top_level' + AND tag = 'world' + """, Sort.ascending("date")); Post.fetchTexts(posts);