Skip to content

Commit

Permalink
Merge pull request kitodo#4771 from sVnsation/fix-delete-project
Browse files Browse the repository at this point in the history
fix foreign key constraint error on deleting project
  • Loading branch information
Kathrin-Huber authored Nov 15, 2021
2 parents 918600e + e21533c commit 6c996c3
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,10 @@ public static void delete(int projectID) throws DAOException, DataException, Pro
user.getProjects().remove(project);
ServiceManager.getUserService().saveToDatabase(user);
}
for (Template template : project.getTemplates()) {
template.getProjects().remove(project);
ServiceManager.getTemplateService().saveToDatabase(template);
}
ServiceManager.getProjectService().remove(project);
}
}

0 comments on commit 6c996c3

Please sign in to comment.