Fix logging in models

This commit is contained in:
Khanh Ngo
2020-01-29 22:18:15 +07:00
parent 2de8bf55f8
commit 23c73f6c52
4 changed files with 22 additions and 15 deletions

View File

@@ -1,3 +1,5 @@
from flask import current_app
from .base import db
@@ -36,7 +38,7 @@ class DomainTemplateRecord(db.Model):
try:
db.session.commit()
except Exception as e:
logging.error(
current_app.logger.error(
'Can not update domain template table. Error: {0}'.format(e))
db.session.rollback()
return {