Skip to content

Commit

Permalink
Fix an error while adding a dependency via UI. (Backport go-gitea#5862)…
Browse files Browse the repository at this point in the history
  • Loading branch information
HarshitOnGitHub authored and zeripath committed Jan 28, 2019
1 parent 28d9305 commit d3a334d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 3 additions & 0 deletions models/issue_comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -748,6 +748,9 @@ func createIssueDependencyComment(e *xorm.Session, doer *User, issue *Issue, dep
if !add {
cType = CommentTypeRemoveDependency
}
if err = issue.loadRepo(e); err != nil {
return
}

// Make two comments, one in each issue
_, err = createComment(e, &CreateCommentOptions{
Expand Down
2 changes: 0 additions & 2 deletions models/issue_dependency_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ func TestCreateIssueDependency(t *testing.T) {

issue1, err := GetIssueByID(1)
assert.NoError(t, err)
issue1.LoadAttributes()

issue2, err := GetIssueByID(2)
assert.NoError(t, err)
issue2.LoadAttributes()

// Create a dependency and check if it was successful
err = CreateIssueDependency(user1, issue1, issue2)
Expand Down

0 comments on commit d3a334d

Please sign in to comment.