mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-04-28 17:32:38 +02:00
ensure current_limit exist before displaying any message based on it
This commit is contained in:
parent
63fba6be4c
commit
d834394a44
1 changed files with 7 additions and 5 deletions
|
@ -192,8 +192,10 @@ def admin():
|
||||||
session["is_admin"] = True
|
session["is_admin"] = True
|
||||||
session.update()
|
session.update()
|
||||||
return redirect(goto)
|
return redirect(goto)
|
||||||
|
if limiter.current_limit is not None:
|
||||||
msg = _(
|
msg = _(
|
||||||
"This admin password is not the right one. Only %(num)d attempts left.",
|
"This admin password is not the right one. Only %(num)d attempts left.",
|
||||||
|
# If the limiter is disabled, there is no current limit
|
||||||
num=limiter.current_limit.remaining,
|
num=limiter.current_limit.remaining,
|
||||||
)
|
)
|
||||||
form["admin_password"].errors = [msg]
|
form["admin_password"].errors = [msg]
|
||||||
|
|
Loading…
Reference in a new issue