From 19f42c11bffbedc34769a699c3701c7eefc1b4d9 Mon Sep 17 00:00:00 2001
From: Arnold Kochari <arnold.kochari@scilifelab.se>
Date: Thu, 12 Dec 2024 15:55:54 +0100
Subject: [PATCH] restrict N of apps on the homepage to only 6 (#268)

---
 portal/views.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/portal/views.py b/portal/views.py
index 0f3353e5..9106c0d2 100644
--- a/portal/views.py
+++ b/portal/views.py
@@ -152,9 +152,9 @@ class HomeView(View):
     def get(self, request, app_id=0):
         published_apps_updated_on, request = get_public_apps(
             request, app_id=app_id, order_by="updated_on", order_reverse=True
-        )[
-            :6
-        ]  # we display only 6 apps
+        )
+        published_apps_updated_on = published_apps_updated_on[:6]  # we display only 6 apps
+        # TODO: add selection of N apps into the function so that it is optimized in the future with more apps in the db
 
         news_objects = NewsObject.objects.all().order_by("-created_on")
         link_all_news = False