~cedric/newspipe

9f29c3e4e399be2205f33a14549b011d018b4849 — Cédric Bonhomme 2 months ago 119a8f3
raise the minimum of characters of a password to 20
3 files changed, 28 insertions(+), 9 deletions(-)

M newspipe/templates/login.html
M newspipe/templates/signup.html
M newspipe/web/forms.py
M newspipe/templates/login.html => newspipe/templates/login.html +1 -1
@@ 4,7 4,7 @@
    <div class="row justify-content-center">
        <div class="col-md-6">
            <h2>{{ _('Log In') }}</h2>
            <form action="{{ url_for('login') }}" method=post>
            <form action="{{ url_for('login') }}" method="post">
                {{ form.hidden_tag() }}
                <div class="input-group mb-3">
                {{ form.nickmane(class_="form-control", placeholder=_('Your nickname')) }}

M newspipe/templates/signup.html => newspipe/templates/signup.html +4 -3
@@ 3,23 3,24 @@
<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-6">
            <h2>{{ _('Sign Up') }}</h2>
            <form action="" method="post" name="save">
                {{ form.hidden_tag() }}
                <div class="input-group mb-3">
                    {{ form.nickname(class_="form-control", placeholder=_('Your nickname')) }}
                    <span class="input-group-text">{{ _('Letters, numbers, dots and underscores only.') }}</span>
                    {% for error in form.nickname.errors %} <span style="color: red;">{{ error }}<br /></span>{% endfor %}
                    &nbsp;<span class="text-muted">{{ _('Letters, numbers, dots and underscores only.') }}</span>
                </div>
                <p class="help-block"></p>
                <div class="input-group mb-3">
                    {{ form.email(class_="form-control", placeholder=_('Your email')) }}
                    <span class="input-group-text">{{ _("Only for account activation. Your email won't be stored.") }}</span>
                    {% for error in form.email.errors %} <span style="color: red;">{{ error }}<br /></span>{% endfor %}
                    &nbsp;<span class="text-muted">{{ _("Only for account activation. Your email won't be stored.") }}</span>
                </div>
                <div class="input-group mb-3">
                    {{ form.password(class_="form-control", placeholder=_('Your password')) }}
                    <span class="input-group-text">{{ _('Minimum 20 characters.') }}</span>
                    {% for error in form.password.errors %} <span style="color: red;">{{ error }}<br /></span>{% endfor %}
                    &nbsp;<span class="text-muted">{{ _('Minimum 6 characters.') }}</span>
                </div>
                <br />
                {{ form.submit(class_="btn btn-primary") }}

M newspipe/web/forms.py => newspipe/web/forms.py +23 -5
@@ 73,7 73,7 @@ class SignupForm(FlaskForm):
        lazy_gettext("Password"),
        [
            validators.Required(lazy_gettext("Please enter a password.")),
            validators.Length(min=6, max=100),
            validators.Length(min=20, max=500),
        ],
    )
    submit = SubmitField(lazy_gettext("Sign up"))


@@ 130,7 130,7 @@ class SigninForm(RedirectForm):
        lazy_gettext("Password"),
        [
            validators.Required(lazy_gettext("Please enter a password.")),
            validators.Length(min=6, max=100),
            validators.Length(min=6, max=500),
        ],
    )
    submit = SubmitField(lazy_gettext("Log In"))


@@ 167,7 167,13 @@ class UserForm(FlaskForm):
        lazy_gettext("Nickname"),
        [validators.Required(lazy_gettext("Please enter your nickname."))],
    )
    password = PasswordField(lazy_gettext("Password"))
    password = PasswordField(
        lazy_gettext("Password"),
        [
            validators.Required(lazy_gettext("Please enter a password.")),
            validators.Length(min=20, max=500),
        ],
    )
    automatic_crawling = BooleanField(lazy_gettext("Automatic crawling"), default=True)
    submit = SubmitField(lazy_gettext("Save"))



@@ 193,8 199,20 @@ class ProfileForm(FlaskForm):
        lazy_gettext("Nickname"),
        [validators.Required(lazy_gettext("Please enter your nickname."))],
    )
    password = PasswordField(lazy_gettext("Password"))
    password_conf = PasswordField(lazy_gettext("Password Confirmation"))
    password = PasswordField(
        lazy_gettext("Password"),
        [
            validators.Required(lazy_gettext("Please enter a password.")),
            validators.Length(min=20, max=500),
        ],
    )
    password_conf = PasswordField(
        lazy_gettext("Password"),
        [
            validators.Required(lazy_gettext("Please enter a password.")),
            validators.Length(min=20, max=500),
        ],
    )
    automatic_crawling = BooleanField(lazy_gettext("Automatic crawling"), default=True)
    bio = TextAreaField(lazy_gettext("Bio"))
    webpage = URLField(lazy_gettext("Webpage"))