Skip to content

Commit

Permalink
Be more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrillkuettel committed Jul 31, 2024
1 parent bdec6b4 commit eb0abff
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/privatim/views/consultations.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,12 @@ def delete_consultation_chain(
# Delete consultations one by one
for consultation in consultations:
# The Status and files will be automatically deleted due to cascade
session.delete(consultation)
try:
session.delete(consultation)
session.flush()
except Exception as e:
session.rollback()
log.error(f'Error deleting consultation: {e}')

session.flush()

Expand Down

0 comments on commit eb0abff

Please sign in to comment.