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
Commits
7dfbaeba
Commit
7dfbaeba
authored
4 years ago
by
Václav Volhejn
Browse files
Options
Downloads
Patches
Plain Diff
Upravit podle komentářů
parent
c054c6b6
No related branches found
No related tags found
1 merge request
!3
Posílání emailů na obnovu hesla
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
config.py.example
+1
-1
1 addition, 1 deletion
config.py.example
mo/util.py
+1
-1
1 addition, 1 deletion
mo/util.py
mo/web/main.py
+6
-3
6 additions, 3 deletions
mo/web/main.py
with
8 additions
and
5 deletions
config.py.example
+
1
−
1
View file @
7dfbaeba
This diff is collapsed.
Click to expand it.
mo/util.py
+
1
−
1
View file @
7dfbaeba
...
...
@@ -37,7 +37,7 @@ def send_password_reset_email(user: db.User, link: str):
addr_spec
=
user
.
email
,
)
]
msg
[
'
Subject
'
]
=
f
'
MO Submit – obnova hesla
'
msg
[
'
Subject
'
]
=
'
MO Submit – obnova hesla
'
msg
[
'
Date
'
]
=
datetime
.
datetime
.
now
()
body
=
textwrap
.
dedent
(
'''
...
...
This diff is collapsed.
Click to expand it.
mo/web/main.py
+
6
−
3
View file @
7dfbaeba
...
...
@@ -52,7 +52,6 @@ def login():
except
RuntimeError
as
e
:
app
.
logger
.
error
(
'
Login: problém při posílání emailu: {}
'
.
format
(
e
))
app
.
logger
.
info
(
'
Link: %s
'
,
link
)
return
render_template
(
'
reset.html
'
)
elif
not
form
.
passwd
.
data
or
not
mo
.
users
.
check_password
(
user
,
form
.
passwd
.
data
):
...
...
@@ -112,8 +111,12 @@ def reset():
mo
.
users
.
cancel_reset_password
(
user
)
db
.
get_session
().
commit
()
return
render_template
(
'
reset.html
'
,
okay
=
'
Obnova hesla zrušena.
'
)
elif
len
(
form
.
passwd
.
data
)
<
4
:
# FIXME
return
render_template
(
'
reset.html
'
,
form
=
form
,
error
=
'
Heslo je příliš krátké.
'
)
elif
len
(
form
.
passwd
.
data
)
<
8
:
return
render_template
(
'
reset.html
'
,
form
=
form
,
error
=
'
Heslo musí být aspoň 8 znaků dlouhé.
'
)
else
:
mo
.
users
.
do_reset_password
(
user
)
mo
.
users
.
set_password
(
user
,
form
.
passwd
.
data
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment