Don't use module level logger functions

This commit is contained in:
Patrick Jentsch
2021-09-16 11:15:31 +02:00
parent 2af74db46f
commit 5469bd0ec1
6 changed files with 48 additions and 39 deletions

View File

@ -1,5 +1,6 @@
from datetime import datetime
from flask import abort, flash, redirect, render_template, request, url_for
from flask import (abort, current_app, flash, redirect, render_template,
request, url_for)
from flask_login import current_user, login_user, login_required, logout_user
from sqlalchemy import or_
from . import bp
@ -8,7 +9,6 @@ from .forms import (LoginForm, ResetPasswordForm, ResetPasswordRequestForm,
from .. import db
from ..email import create_message, send
from ..models import User
import logging
import os
@ -68,7 +68,9 @@ def register():
try:
os.makedirs(user.path)
except OSError:
logging.error('Make dir {} led to an OSError!'.format(user.path))
current_app.logger.error(
'Make dir {} led to an OSError!'.format(user.path)
)
db.session.delete(user)
db.session.commit()
abort(500)