diff --git a/kfet/templates/kfet/kpsul.html b/kfet/templates/kfet/kpsul.html
index 3ac32345..b5f768eb 100644
--- a/kfet/templates/kfet/kpsul.html
+++ b/kfet/templates/kfet/kpsul.html
@@ -959,6 +959,7 @@ $(document).ready(function() {
function getHistory() {
var data = {
from: moment().subtract(1, 'days').format('YYYY-MM-DD HH:mm:ss'),
+ limit: 100,
};
$.ajax({
dataType: "json",
diff --git a/kfet/views.py b/kfet/views.py
index d0bc54fb..05eb1d16 100644
--- a/kfet/views.py
+++ b/kfet/views.py
@@ -1248,6 +1248,7 @@ def history_json(request):
# Récupération des paramètres
from_date = request.POST.get('from', None)
to_date = request.POST.get('to', None)
+ limit = request.POST.get('limit', None);
checkouts = request.POST.getlist('checkouts[]', None)
accounts = request.POST.getlist('accounts[]', None)
@@ -1274,6 +1275,9 @@ def history_json(request):
# Un non-membre de l'équipe n'a que accès à son historique
if not request.user.has_perm('kfet.is_team'):
opegroups = opegroups.filter(on_acc=request.user.profile.account_kfet)
+ if limit:
+ opegroups = opegroups[:limit]
+
# Construction de la réponse
opegroups_list = []