Fix some copy/paste and other syntax errors from the validators commit.

450613, 457124
This commit is contained in:
Rob Crittenden
2008-08-14 11:34:40 -04:00
parent cee4b2cc1e
commit a013fe5cc2
2 changed files with 4 additions and 5 deletions

View File

@@ -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)

View File

@@ -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 $'),
}