fix use of SetFELog with log_level="error" => level="danger"
This commit is contained in:
2
main.py
2
main.py
@@ -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.
|
||||
|
||||
@@ -94,7 +94,7 @@ def AddRefimgToPerson( filename, person ):
|
||||
except Exception as e:
|
||||
# can fail "silently" here, if the face_locn worked, great, its only
|
||||
# a tmp file in /tmp - if not, the next if will send a msg to the front-end
|
||||
SetFELog( message=f"Failed to delete tmp file for refimg addition: {e}", log_level="danger", persistent=True, cant_close=True )
|
||||
SetFELog( message=f"Failed to delete tmp file for refimg addition: {e}", level="danger", persistent=True, cant_close=True )
|
||||
|
||||
if not face_locn:
|
||||
SetFELog( f"<b>Failed to find face in Refimg:</b>", "danger" )
|
||||
|
||||
@@ -137,7 +137,7 @@ def SettingsRBPath():
|
||||
settings = Settings.query.first()
|
||||
if settings == None:
|
||||
from job import SetFELog
|
||||
SetFELog( message="Cannot create file data with no settings / recycle bin path is missing", log_level="error", persistent=True, cant_close=False)
|
||||
SetFELog( message="Cannot create file data with no settings / recycle bin path is missing", level="danger", persistent=True, cant_close=False)
|
||||
return
|
||||
# path setting is an absolute path, just use it, otherwise prepend base_path first
|
||||
if settings.recycle_bin_path[0] == '/':
|
||||
@@ -155,7 +155,7 @@ def SettingsSPath():
|
||||
settings = Settings.query.first()
|
||||
if settings == None:
|
||||
from job import SetFELog
|
||||
SetFELog( message="Cannot create file data with no settings / storage path is missing", log_level="error", persistent=True, cant_close=False)
|
||||
SetFELog( message="Cannot create file data with no settings / storage path is missing", level="danger", persistent=True, cant_close=False)
|
||||
return
|
||||
if settings.storage_path[0] == '/':
|
||||
path=settings.storage_path
|
||||
|
||||
Reference in New Issue
Block a user