When the user tries to delete a Term which has been applied to a license the error message "There was an error deleting term [term_name]: org.hibernate.exception.ConstraintViolationException: could not execute statement" is displayed.
Steps to Reproduce:
- Log into snapshot as diku_admin.
- In the license app, Edit a license.
- Apply a term and Save the license.
- Open the Settings app and go to Licenses > Terms,
- Locate the term applied in step 3 and select "Delete",
- Confirm the deletion (select the "Delete" button in the "Delete term" modal").
The same error is displayed when the term is applied to an Amendment rather than a license.