mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Fix some copy/paste and other syntax errors from the validators commit.
450613, 457124
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -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 $'),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user