diff options
-rw-r--r-- | ipa-server/ipa-gui/ipagui/forms/group.py | 6 | ||||
-rw-r--r-- | ipa-server/ipa-gui/ipagui/helpers/validators.py | 3 |
2 files changed, 4 insertions, 5 deletions
diff --git a/ipa-server/ipa-gui/ipagui/forms/group.py b/ipa-server/ipa-gui/ipagui/forms/group.py index dc3ac0608..6cbf9262f 100644 --- a/ipa-server/ipa-gui/ipagui/forms/group.py +++ b/ipa-server/ipa-gui/ipagui/forms/group.py @@ -18,7 +18,7 @@ import turbogears from turbogears import validators, widgets from tg_expanding_form_widget.tg_expanding_form_widget import ExpandingForm -from ipagui.helpers import ipahelper +from ipagui.helpers import ipahelper,validators class GroupFields(object): cn = widgets.TextField(name="cn", label="Name") @@ -36,7 +36,7 @@ class GroupFields(object): dn_to_info_json = widgets.HiddenField(name="dn_to_info_json") class GroupNewValidator(validators.Schema): - cn = GoodName(not_empty=True) + cn = validators.GoodName(not_empty=True) description = validators.String(not_empty=False) @@ -59,7 +59,7 @@ class GroupNewForm(widgets.Form): class GroupEditValidator(validators.Schema): - cn = GoodName(not_empty=False) + cn = validators.GoodName(not_empty=False) gidnumber = validators.Int(not_empty=False) description = validators.String(not_empty=False) diff --git a/ipa-server/ipa-gui/ipagui/helpers/validators.py b/ipa-server/ipa-gui/ipagui/helpers/validators.py index 27272595b..8ed73b87c 100644 --- a/ipa-server/ipa-gui/ipagui/helpers/validators.py +++ b/ipa-server/ipa-gui/ipagui/helpers/validators.py @@ -88,6 +88,5 @@ class GoodName(Regex): regex = r"^[a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,30}[a-zA-Z0-9_.$-]?$" messages = { - 'invalid': _('Enter only letters, numbers, _ (underscore), - (dash) or -$'), + 'invalid': _('Enter only letters, numbers, _ (underscore), - (dash) or $'), } |