fix use of SetFELog with log_level="error" => level="danger"

This commit is contained in:
2024-01-21 18:17:45 +11:00
parent a3350b9316
commit 4db3d27cbc
3 changed files with 4 additions and 4 deletions

View File

@@ -142,7 +142,7 @@ def login():
# ldap-injecting our username, so send them back to the login page instead
if request.method == 'POST' and re.search( r'[()\\*&!]', request.form['username']):
from job import SetFELog
SetFELog( message=f"ERROR: Detected special LDAP chars in username: {request.form['username']}", log_level="error", persistent=True, cant_close=True )
SetFELog( message=f"ERROR: Detected special LDAP chars in username: {request.form['username']}", level="danger", persistent=True, cant_close=True )
return redirect(url_for('login'))
if form.validate_on_submit():
# Successfully logged in, We can now access the saved user object via form.user.