Exemplo n.º 1
0
class RegisterUserForm(ModestForm):
    firstname = StringField(
        _('First Name'),
        validators=[DataRequired(message=_('First name must not be empty'))],
        filters=[strip],
    )

    lastname = StringField(
        _('Last Name'),
        validators=[DataRequired(message=_('Last name must not be empty'))],
        filters=[strip],
    )

    username = StringField(
        _('Username'),
        validators=[DataRequired(message=_('User name must not be empty'))],
        filters=[strip],
    )

    mail = EmailField(
        _('E-mail Address'),
        validators=[
            DataRequired(message=_('Email must not be empty')),
            Email(
                message=_('Email must be valid'),
                blocklist=app.config["MAIL_DOMAIN_BLOCKLIST"],
            ),
        ],
        filters=[strip],
    )

    submit = SubmitButtonField(_("Register"))
Exemplo n.º 2
0
class UserSettingsProfileForm(BaseForm):
    firstname = StringField(
        _('First Name'),
        validators=[DataRequired(message=_('First name must not be empty'))],
    )

    lastname = StringField(
        _('Last Name'),
        validators=[DataRequired(message=_('Last name must not be empty'))],
    )

    mail = EmailField(
        _('E-mail Address'),
        validators=[
            DataRequired(message=_('Email must not be empty')),
            Email(message=_('Email must be valid')),
        ],
    )

    locale = SelectField(
        _('Locale'),
        choices=[(locale, locale) for locale in LOCALES],
        validators=[
            DataRequired(message=_('Locale must not be empty')),
            AnyOf(LOCALES, message=_('Locale must be a valid locale short-code')),
        ],
    )

    ircnick = CSVListField(_('IRC Nicknames'), validators=[Optional()])

    timezone = SelectField(
        _('Timezone'),
        choices=[(t, t) for t in TIMEZONES],
        validators=[
            DataRequired(message=_('Timezone must not be empty')),
            AnyOf(TIMEZONES, message=_('Timezone must be a valid timezone')),
        ],
    )

    github = StringField(_('GitHub Username'), validators=[Optional()])

    gitlab = StringField(_('GitLab Username'), validators=[Optional()])

    rhbz_mail = EmailField(_('Red Hat Bugzilla Email'), validators=[Optional()])

    website_url = URLField(
        _('Website or Blog URL'),
        validators=[Optional(), URL(message=_('Valid URL required'))],
    )

    is_private = BooleanField(
        _('Private'),
        description=_(
            "Hide information from other users, see the Privacy Policy for details."
        ),
        validators=[Optional()],
    )
Exemplo n.º 3
0
class UserSettingsProfileForm(BaseForm):
    firstname = StringField(
        _('First Name'),
        validators=[DataRequired(message=_('First name must not be empty'))],
    )

    lastname = StringField(
        _('Last Name'),
        validators=[DataRequired(message=_('Last name must not be empty'))],
    )

    mail = EmailField(
        _('E-mail Address'),
        validators=[
            DataRequired(message=_('Email must not be empty')),
            Email(
                message=_('Email must be valid'),
                blocklist=app.config["MAIL_DOMAIN_BLOCKLIST"],
            ),
        ],
    )

    locale = SelectField(
        _('Locale'),
        choices=[(locale, locale) for locale in LOCALES],
        validators=[
            DataRequired(message=_('Locale must not be empty')),
            AnyOf(LOCALES,
                  message=_('Locale must be a valid locale short-code')),
        ],
    )

    ircnick = CSVListField(_('IRC Nicknames'), validators=[Optional()])

    timezone = SelectField(
        _('Timezone'),
        choices=[(t, t) for t in TIMEZONES],
        validators=[
            DataRequired(message=_('Timezone must not be empty')),
            AnyOf(TIMEZONES, message=_('Timezone must be a valid timezone')),
        ],
    )

    github = StringField(_('GitHub Username'), validators=[Optional()])

    gitlab = StringField(_('GitLab Username'), validators=[Optional()])

    rhbz_mail = EmailField(_('Red Hat Bugzilla Email'),
                           validators=[Optional()])

    website_url = URLField(
        _('Website or Blog URL'),
        validators=[Optional(),
                    URL(message=_('Valid URL required'))],
    )
Exemplo n.º 4
0
class RegisterUserForm(ModestForm):
    firstname = StringField(
        _('First Name'),
        validators=[DataRequired(message=_('First name must not be empty'))],
        filters=[strip],
    )

    lastname = StringField(
        _('Last Name'),
        validators=[DataRequired(message=_('Last name must not be empty'))],
        filters=[strip],
    )

    username = StringField(
        _('Username'),
        validators=[DataRequired(message=_('User name must not be empty'))],
        filters=[strip],
    )

    mail = EmailField(
        _('E-mail Address'),
        validators=[
            DataRequired(message=_('Email must not be empty')),
            Email(message=_('Email must be valid')),
        ],
        filters=[strip],
    )

    underage = BooleanField(
        _('I am over 16 years old'),
        validators=[
            DataRequired(message=_(
                "You must be over 16 years old to create an account"))
        ],
    )

    submit = SubmitButtonField(_("Register"))