remove circular dependencies on SetFELog

This commit is contained in:
2023-04-09 13:21:44 +10:00
parent a84ff49413
commit 5bd925fa5a
2 changed files with 3 additions and 2 deletions

View File

@@ -64,7 +64,6 @@ from files import Entry
from person import Person
from settings import Settings
from user import PAUser
from job import SetFELog
####################################### GLOBALS #######################################
# allow jinja2 to call these python functions directly
@@ -120,6 +119,7 @@ def login():
# the re matches on any special LDAP chars, we dont want someone
# 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 )
return redirect(url_for('login'))
if form.validate_on_submit():