Beautified creation of new dependency

Signed-off-by: Konrad <konrad@kola-entertainments.de>
This commit is contained in:
Konrad Langenberg 2017-09-23 14:14:41 +02:00 committed by Konrad
parent 301f247efe
commit bccb37c08c

View File

@ -38,12 +38,13 @@ func CreateIssueDependency(user *User, issue, dep *Issue) (exists bool, err erro
// If it not exists, create it, otherwise show an error message // If it not exists, create it, otherwise show an error message
if !exists { if !exists {
newID := new(IssueDependency) newIssueDependency:= &IssueDependency{
newID.UserID = user.ID UserID: user.ID,
newID.IssueID = issue.ID IssueID: issue.ID,
newID.DependencyID = dep.ID DependencyID: dep.ID,
}
if _, err := x.Insert(newID); err != nil { if _, err := x.Insert(newIssueDependency); err != nil {
return exists, err return exists, err
} }