Skip to content

Commit

Permalink
Convert LOGS_PER_PAGE from static settings to appsettings
Browse files Browse the repository at this point in the history
  • Loading branch information
catborise committed Jun 4, 2020
1 parent 5e00f89 commit e21f423
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions admin/views.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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})

0 comments on commit e21f423

Please sign in to comment.