Skip to content

Commit

Permalink
Update aiida/orm/implementation/sqlalchemy/utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisjsewell authored Sep 9, 2021
1 parent a8b3265 commit 3313c10
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions aiida/orm/implementation/sqlalchemy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ def is_saved(self):
:return: boolean, True if the model is saved in the database, False otherwise
"""
# we should not flush here since it may lead to IntegrityErrors
# which are handled later in the save method
with self._model.session.no_autoflush:
return self._model.id is not None

Expand Down

0 comments on commit 3313c10

Please sign in to comment.