aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2021-07-03 22:16:17 +0200
committerCédric Bonhomme <cedric@cedricbonhomme.org>2021-07-03 22:16:17 +0200
commit9f29c3e4e399be2205f33a14549b011d018b4849 (patch)
tree22843a3c2e062db5349514f1bbdc615dd2af9ae1
parentdeleted read article (and not liked) that are retrieved since more than 15 days. (diff)
downloadnewspipe-9f29c3e4e399be2205f33a14549b011d018b4849.tar.gz
newspipe-9f29c3e4e399be2205f33a14549b011d018b4849.tar.bz2
newspipe-9f29c3e4e399be2205f33a14549b011d018b4849.zip
raise the minimum of characters of a password to 20
-rw-r--r--newspipe/templates/login.html2
-rw-r--r--newspipe/templates/signup.html7
-rw-r--r--newspipe/web/forms.py28
3 files changed, 28 insertions, 9 deletions
diff --git a/newspipe/templates/login.html b/newspipe/templates/login.html
index 94037d81..5d936d18 100644
--- a/newspipe/templates/login.html
+++ b/newspipe/templates/login.html
@@ -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')) }}
diff --git a/newspipe/templates/signup.html b/newspipe/templates/signup.html
index 68ebbb6a..7189c186 100644
--- a/newspipe/templates/signup.html
+++ b/newspipe/templates/signup.html
@@ -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") }}
diff --git a/newspipe/web/forms.py b/newspipe/web/forms.py
index ad9cca43..33a8db70 100644
--- a/newspipe/web/forms.py
+++ b/newspipe/web/forms.py
@@ -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"))
bgstack15