fix merge with master

This commit is contained in:
2022-03-06 12:38:50 +00:00
committed by Patrick Mayr
parent bf9429ace7
commit 34abb3acf3
4 changed files with 19 additions and 17 deletions

View File

@@ -202,7 +202,7 @@ def show(request, id=None):
"author": author,
"author_image": author_image,
"next": __next(post, public_only),
"previous": get_previous_dict(p),
"previous": __previous(post, public_only),
"related_posts": related_posts[0:6],
"ep_agenda_link": ep_agenda_link,
"ep_protocol_link": ep_protocol_link,
@@ -285,17 +285,15 @@ def __next(post=None, public=True):
return d
def get_previous_dict(post=None):
# TODO: Docstring
def __previous(post=None, public=True):
"""
Helper function for getting previous post
"""
posts = None
d = post.slug
if post:
# TODO: bad implementation but it works!!
if post.post_type == "N" or post.post_type == "E":
posts = Post.articles.get_visible_articles()
elif post.post_type == "F":
posts = FetMeeting.objects.get_queryset().order_by("-event_start")
posts = Post.objects.date_sorted_list(public).filter(post_type=post.post_type)
if posts:
for k, v in enumerate(posts):