|
|
@ -45,9 +45,13 @@ func Releases(ctx *middleware.Context) { |
|
|
|
if rel.TagName == rawTag { |
|
|
|
if rel.TagName == rawTag { |
|
|
|
rel.Publisher, err = models.GetUserByID(rel.PublisherID) |
|
|
|
rel.Publisher, err = models.GetUserByID(rel.PublisherID) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
|
|
|
|
if models.IsErrUserNotExist(err) { |
|
|
|
|
|
|
|
rel.Publisher = models.NewFakeUser() |
|
|
|
|
|
|
|
} else { |
|
|
|
ctx.Handle(500, "GetUserByID", err) |
|
|
|
ctx.Handle(500, "GetUserByID", err) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
// FIXME: duplicated code.
|
|
|
|
// FIXME: duplicated code.
|
|
|
|
// Get corresponding target if it's not the current branch.
|
|
|
|
// Get corresponding target if it's not the current branch.
|
|
|
|
if ctx.Repo.BranchName != rel.Target { |
|
|
|
if ctx.Repo.BranchName != rel.Target { |
|
|
@ -105,9 +109,13 @@ func Releases(ctx *middleware.Context) { |
|
|
|
|
|
|
|
|
|
|
|
rel.Publisher, err = models.GetUserByID(rel.PublisherID) |
|
|
|
rel.Publisher, err = models.GetUserByID(rel.PublisherID) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
|
|
|
|
if models.IsErrUserNotExist(err) { |
|
|
|
|
|
|
|
rel.Publisher = models.NewFakeUser() |
|
|
|
|
|
|
|
} else { |
|
|
|
ctx.Handle(500, "GetUserByID", err) |
|
|
|
ctx.Handle(500, "GetUserByID", err) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
// FIXME: duplicated code.
|
|
|
|
// FIXME: duplicated code.
|
|
|
|
// Get corresponding target if it's not the current branch.
|
|
|
|
// Get corresponding target if it's not the current branch.
|
|
|
|
if ctx.Repo.BranchName != rel.Target { |
|
|
|
if ctx.Repo.BranchName != rel.Target { |
|
|
|