diff --git a/kfet/static/kfet/js/kfet.js b/kfet/static/kfet/js/kfet.js index bdf5b69b..6bd03a1f 100644 --- a/kfet/static/kfet/js/kfet.js +++ b/kfet/static/kfet/js/kfet.js @@ -133,6 +133,9 @@ function getErrorsHtml(data) { content += '
  • Montant invalide
  • '; content += ''; } + if ('account' in data['errors']) { + content += data['errors']['account']; + } return content; } diff --git a/kfet/views.py b/kfet/views.py index b6a3338a..823a205d 100644 --- a/kfet/views.py +++ b/kfet/views.py @@ -1041,7 +1041,9 @@ def kpsul_perform_operations(request): operationgroup.comment = operationgroup.comment.strip() if not operationgroup.comment: data['errors']['need_comment'] = True - return JsonResponse(data, status=400) + + if data['errors']: + return JsonResponse(data, status=400) if stop or not request.user.has_perms(required_perms): missing_perms = get_missing_perms(required_perms, request.user)