replace if-cases to annotate

This commit is contained in:
2022-01-17 09:37:06 +00:00
parent e128996cb7
commit 91e6341acf
7 changed files with 65 additions and 87 deletions

View File

@@ -250,11 +250,7 @@ def __next(post=None, public=True):
d = post.slug
if post:
# TODO: bad implementation but it works!!
if post.post_type == "N" or post.post_type == "E":
posts = Post.articles.date_sorted_list(public)
elif post.post_type == "F":
posts = FetMeeting.objects.published(public)
posts = Post.objects.date_sorted_list(public).filter(post_type=post.post_type)
if posts:
for k, v in enumerate(posts):