Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Odevzdávací Systém MO
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Mareš
Odevzdávací Systém MO
Merge requests
!86
Registrace
Code
Review changes
Check out branch
Download
Patches
Plain diff
Expand sidebar
Merged
Registrace
mj/registrace
into
devel
Overview
49
Commits
38
Changes
2
Merged
Martin Mareš
requested to merge
mj/registrace
into
devel
3 years ago
Overview
49
Commits
38
Changes
2
Implementace registrace podle
#220 (closed)
.
Edited
3 years ago
by
Martin Mareš
0
0
Merge request reports
Viewing commit
7939fbf6
Prev
Next
Show latest version
2 files
+
10
−
3
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
7939fbf6
Společná funkce na kontrolu přípustnosti hesla
· 7939fbf6
Martin Mareš
authored
3 years ago
mo/web/auth.py
+
3
−
3
View file @ 7939fbf6
Edit in single-file editor
Open in Web IDE
Show full file
@@ -127,7 +127,7 @@ def handle_need_login(e):
class
ResetForm
(
FlaskForm
):
email
=
EmailField
(
'
E-mail
'
,
description
=
'
Účet pro který se nastavuje nové heslo
'
,
render_kw
=
{
"
disabled
"
:
"
disabled
"
})
token
=
wtforms
.
HiddenField
()
passwd
=
wtforms
.
PasswordField
(
'
Nové heslo
'
,
description
=
'
Heslo musí mít alespoň 8 znaků. Doporučujeme kombinovat velká a malá písmena a číslice.
'
)
passwd
=
wtforms
.
PasswordField
(
'
Nové heslo
'
,
description
=
mo
.
users
.
password_help
)
submit
=
wtforms
.
SubmitField
(
'
Nastavit heslo
'
)
cancel
=
wtforms
.
SubmitField
(
'
Zrušit obnovu hesla
'
)
@@ -155,8 +155,8 @@ def reset():
db
.
get_session
().
commit
()
flash
(
'
Obnova hesla zrušena
'
,
'
warning
'
)
return
redirect
(
url_for
(
'
login
'
))
elif
len
(
form
.
passwd
.
data
)
<
8
:
flash
(
'
Heslo musí být aspoň 8 znaků dlouhé
'
,
'
danger
'
)
elif
not
mo
.
users
.
validate_password
(
form
.
passwd
.
data
):
flash
(
mo
.
users
.
password_help
,
'
danger
'
)
return
render_template
(
'
reset.html
'
,
form
=
form
)
else
:
mo
.
users
.
do_reset_password
(
user
)
Loading