mirror of
https://github.com/sb745/NyaaV3.git
synced 2025-03-12 22:06:55 +02:00
account: force ASCII usernames on login form
Our database doesn't like it when we check for unicode data in a column that stores ASCII data, so let's stop it before it gets that far.
This commit is contained in:
parent
da931875bc
commit
fd39525ada
1 changed files with 3 additions and 0 deletions
|
@ -26,6 +26,9 @@ def login():
|
|||
return flask.redirect(flask.url_for('account.login'))
|
||||
|
||||
username = form.username.data.strip()
|
||||
if not username.isascii():
|
||||
flask.flash('Invalid characters in username.', 'danger')
|
||||
return flask.redirect(flask.url_for('account.login'))
|
||||
password = form.password.data
|
||||
user = models.User.by_username(username)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue