Fix paging context for eventlog view
This commit is contained in:
1 parent
afdf656525
commit
11b1f40d7d
1 file changed
+4
-4
+4
-4
@@ -264,10 +264,10 @@ def eventLog(request, page=1, pageLength=50):
|
|||||||
# Choose events within the given page, if any
|
# Choose events within the given page, if any
|
||||||
events = LogEvent.objects.all().order_by('-id')
|
events = LogEvent.objects.all().order_by('-id')
|
||||||
items = len(events)
|
items = len(events)
|
||||||
start = page * pageLength
|
start = (page - 1) * pageLength
|
||||||
end = start + pageLength
|
end = page * pageLength
|
||||||
start = max(1, min(start, items))
|
start = max(0, min(start, items))
|
||||||
end = max(1, min(end, items))
|
end = max(0, min(end, items))
|
||||||
paging = pagingContext(page, pageLength, items, 'eventLog')
|
paging = pagingContext(page, pageLength, items, 'eventLog')
|
||||||
|
|
||||||
# Build context dictionary for event log template
|
# Build context dictionary for event log template
|
||||||
|
|||||||
Reference in new issue
Block a user