Project

General

Profile

Tâche #26395

Scénario #26331: Traitement express MEN (2-4)

Message d’erreur incohérent avec la règle de validation pour valid_entier

Added by Benjamin Bohard over 4 years ago. Updated over 4 years ago.

Status:
Fermé
Priority:
Normal
Start date:
01/29/2018
Due date:
% Done:

100%

Remaining (hours):
0.0

Description

def valid_entier(data, mini=None, maxi=None):
    """ fonction de validation d'un nombre (intervalle optionnel)""" 
    if data == "":
        return True
    try:
        value = int(data)
    except ValueError:
        raise ValueError(_(u"A number is required."))
    else:
        if mini is not None and value < int(mini):
            raise ValueError(_(u"Give an integer greater than {0}").format(mini))
        if maxi is not None and value > int(maxi):
            raise ValueError(_(u"Give an integer lesser than {0}").format(maxi))
        return True

Si on met la valeur limite haute, pas d’erreur mais si on met une unité supérieure, il est demandé de mettre un entier inférieur à la borne haute.

Associated revisions

Revision 9bee70bd (diff)
Added by Gérald Schwartzmann over 4 years ago

Change of message meaning in valid_entier

Ref: #26395

Revision 405499c1 (diff)
Added by Gérald Schwartzmann over 4 years ago

Change traduction for message meaning in valid_entier

Ref: #26395

History

#1 Updated by Scrum Master over 4 years ago

  • Status changed from Nouveau to En cours

#2 Updated by Gérald Schwartzmann over 4 years ago

  • Assigned To set to Gérald Schwartzmann

#3 Updated by Gérald Schwartzmann over 4 years ago

  • Status changed from En cours to Résolu

#4 Updated by Joël Cuissinat over 4 years ago

Modification appliquée sur EOLE >= 2.7.1.

#5 Updated by Joël Cuissinat over 4 years ago

  • Status changed from Résolu to Fermé
  • % Done changed from 0 to 100
  • Remaining (hours) set to 0.0

Vu pour le swappiness :

/!\ "101" est une valeur invalide pour l'option "Poids relatif de l'utilisation de la swap par rapport à la mémoire vive" de type nombre, Donnez un entier inférieur ou égal à 100
/!\ "-1" est une valeur invalide pour l'option "Poids relatif de l'utilisation de la swap par rapport à la mémoire vive" de type nombre, Donnez un entier supérieur ou égal à 0

Also available in: Atom PDF