From e21f423bcf4467670565b0ef8ed85cc2b4cff3b5 Mon Sep 17 00:00:00 2001 From: catborise Date: Thu, 4 Jun 2020 14:35:34 +0300 Subject: [PATCH] Convert LOGS_PER_PAGE from static settings to appsettings --- admin/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/views.py b/admin/views.py index 955f23f..f6c47cd 100644 --- a/admin/views.py +++ b/admin/views.py @@ -1,10 +1,10 @@ -from django.conf import settings from django.contrib.auth.models import Group, User from django.core.paginator import Paginator from django.shortcuts import get_object_or_404, redirect, render from django.utils.translation import ugettext_lazy as _ from accounts.models import UserAttributes +from appsettings.views import AppSettings from logs.models import Logs from . import forms @@ -165,7 +165,7 @@ def user_unblock(request, pk): @superuser_only def logs(request): l = Logs.objects.order_by('-date') - paginator = Paginator(l, settings.LOGS_PER_PAGE) + paginator = Paginator(l, int(AppSettings.objects.get(key="LOGS_PER_PAGE").value)) page = request.GET.get('page', 1) logs = paginator.page(page) return render(request, 'admin/logs.html', {'logs': logs})