Marcin Kuzminski - 15 years ago 2010-11-18 23:07:04 marcin@python-works.com
fixes #69 password confirmation for register dialog. Fixes appcrash when using some special characters in register field fixes app crash when no email config is enabled
4 files changed with 67 insertions and 18 deletions:
The table below outlines the options which can be used in a schema in addition to the validators themselves
pre_validators [] These validators will be applied before the schema
chained_validators [] These validators will be applied after the schema
allow_extra_fields False If True, then it is not an error when keys that aren't associated with a validator are present
filter_extra_fields False If True, then keys that aren't associated with a validator are removed
if_key_missing NoDefault If this is given, then any keys that aren't available but are expected will be replaced with this value (and then validated). This does not override a present .if_missing attribute on validators. NoDefault is a special FormEncode class to mean that no default values has been specified and therefore missing keys shouldn't take a default value.
ignore_key_missing False If True, then missing keys will be missing in the result, if the validator doesn't have .if_missing on it already
<name> = formencode.validators.<name of validator>
<name> must equal form name
list=[1,2,3,4,5]
for SELECT use formencode.All(OneOf(list), Int())
"""
from formencode import All
from formencode.validators import UnicodeString, OneOf, Int, Number, Regex, \
Email, Bool, StringBoolean
from pylons import session
from pylons.i18n.translation import _
from rhodecode.lib.auth import authfunc, get_crypt_password
from rhodecode.lib.exceptions import LdapImportError
from rhodecode.model import meta
from rhodecode.model.user import UserModel
from rhodecode.model.repo import RepoModel
from rhodecode.model.db import User
from webhelpers.pylonslib.secure_form import authentication_token
from rhodecode import BACKENDS
import formencode
import logging
import os
import rhodecode.lib.helpers as h
log = logging.getLogger(__name__)
#this is needed to translate the messages using _() in validators