Skip to content
This repository has been archived by the owner on Sep 12, 2018. It is now read-only.

Commit

Permalink
Project: Fix server error while deleting
Browse files Browse the repository at this point in the history
Fix a bug that a referential integiry exception occurrs while deleting
a project which has an issue to which a label is attached. Delete issues
first because labels cannot be deleted if there is an issue refers them.
  • Loading branch information
Yi EungJun committed Nov 13, 2014
1 parent 3993cdb commit 1411db7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/models/Project.java
Original file line number Diff line number Diff line change
Expand Up @@ -609,14 +609,16 @@ public void delete() {
label.update();
}

for(IssueLabelCategory category : IssueLabelCategory.findByProject(this)) {
category.delete();
}

// Issues must be deleted before issue labels because issues may refer
// issue labels.
for(Issue issue : issues) {
issue.delete();
}

for(IssueLabelCategory category : IssueLabelCategory.findByProject(this)) {
category.delete();
}

for (Assignee assignee : assignees) {
assignee.delete();
}
Expand Down

0 comments on commit 1411db7

Please sign in to comment.