From 444678a65af0eb68c115cfc63f4ca6502b9aa456 Mon Sep 17 00:00:00 2001 From: Patrick Mayr Date: Thu, 20 Jan 2022 12:33:19 +0000 Subject: [PATCH] set only the pinned post if there is one to pin. --- fet2020/fet2020/views.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/fet2020/fet2020/views.py b/fet2020/fet2020/views.py index 053355ac..ad3af9ee 100644 --- a/fet2020/fet2020/views.py +++ b/fet2020/fet2020/views.py @@ -18,11 +18,7 @@ def index(request): # set the pinned post pinned_post = Post.articles.pinned() - if not pinned_post: - # if a pinned post does not exist, take the last published one. - if len(posts) >= 1: - pinned_post = posts.popleft() - else: + if pinned_post: # remove the pinned post posts.remove(pinned_post)