From 9fb875f74913ced7169aa6718ea479c0aaac14d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Jastrz=C4=99bski?= Date: Fri, 30 Apr 2021 08:36:50 +0200 Subject: [PATCH] Add DASHBOARD_PAGE_SIZE to settings --- shynet/dashboard/views.py | 2 +- shynet/shynet/settings.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/shynet/dashboard/views.py b/shynet/dashboard/views.py index c071143..791080f 100644 --- a/shynet/dashboard/views.py +++ b/shynet/dashboard/views.py @@ -25,7 +25,7 @@ from .mixins import DateRangeMixin class DashboardView(LoginRequiredMixin, DateRangeMixin, ListView): model = Service template_name = "dashboard/pages/dashboard.html" - paginate_by = 5 + paginate_by = settings.DASHBOARD_PAGE_SIZE def get_queryset(self): return Service.objects.filter( diff --git a/shynet/shynet/settings.py b/shynet/shynet/settings.py index 9bd510e..4abb694 100644 --- a/shynet/shynet/settings.py +++ b/shynet/shynet/settings.py @@ -339,3 +339,5 @@ BLOCK_ALL_IPS = os.getenv("BLOCK_ALL_IPS", "False") == "True" # Include date and service ID in salt? AGGRESSIVE_HASH_SALTING = os.getenv("AGGRESSIVE_HASH_SALTING", "False") == "True" + +DASHBOARD_PAGE_SIZE = os.getenv("DASHBOARD_PAGE_SIZE", 5)