diff --git a/datagateway_api/common/database/helpers.py b/datagateway_api/common/database/helpers.py index c57d38ff..bf19a65d 100644 --- a/datagateway_api/common/database/helpers.py +++ b/datagateway_api/common/database/helpers.py @@ -3,8 +3,8 @@ from functools import wraps import logging -from sqlalchemy.orm import aliased from flask_sqlalchemy import SQLAlchemy +from sqlalchemy.orm import aliased from datagateway_api.common.database.filters import ( DatabaseIncludeFilter as IncludeFilter, @@ -30,6 +30,7 @@ db = SQLAlchemy() + def requires_session_id(method): """ Decorator for database backend methods that makes sure a valid session_id is @@ -89,7 +90,7 @@ def commit_changes(self): try: self.session.commit() except Exception as e: - log.error(f"Error whilst committing changes to {self.table}, rolling back") + log.error("Error whilst committing changes to %s, rolling back", self.table) self.session.rollback() raise e