Ce serveur Gitlab sera éteint le 30 juin 2020, pensez à migrer vos projets vers les serveurs gitlab-research.centralesupelec.fr et gitlab-student.centralesupelec.fr !

...
 
Commits (1)
......@@ -643,7 +643,7 @@ def control(request):
fields=('control', 'valid'),
extra=0
)
invoice_list = re2o_paginator(request, invoice_list, pagination_number)
invoice_list = re2o_paginator(request, invoice_list, pagination_number, force_paginate=True)
control_invoices_form = control_invoices_formset(
request.POST or None,
queryset=invoice_list.object_list
......
......@@ -128,7 +128,7 @@ def index(request):
request.GET.get('order'),
SortTable.LOGS_INDEX
)
versions = re2o_paginator(request, versions, pagination_number)
versions = re2o_paginator(request, versions, pagination_number, force_paginate=True)
# Force to have a list instead of QuerySet
versions.count(0)
# Items to remove later because invalid
......
......@@ -292,12 +292,12 @@ class SortTable:
return request
def re2o_paginator(request, query_set, pagination_number):
def re2o_paginator(request, query_set, pagination_number, force_paginate=False):
"""Paginator script for list display in re2o.
:request:
:query_set: Query_set to paginate
:pagination_number: Number of entries to display"""
if query_set.count() > pagination_number:
if force_paginate or query_set.count() > pagination_number:
paginator = Paginator(query_set, pagination_number)
page = request.GET.get('page')
try:
......