|
|
@ -45,8 +45,12 @@ 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 { |
|
|
|
ctx.Handle(500, "GetUserByID", err) |
|
|
|
if models.IsErrUserNotExist(err) { |
|
|
|
return |
|
|
|
rel.Publisher = models.NewFakeUser() |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
ctx.Handle(500, "GetUserByID", err) |
|
|
|
|
|
|
|
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.
|
|
|
@ -105,8 +109,12 @@ 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 { |
|
|
|
ctx.Handle(500, "GetUserByID", err) |
|
|
|
if models.IsErrUserNotExist(err) { |
|
|
|
return |
|
|
|
rel.Publisher = models.NewFakeUser() |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
ctx.Handle(500, "GetUserByID", err) |
|
|
|
|
|
|
|
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.
|
|
|
|