mirror of https://github.com/go-gitea/gitea.git
Fix bug
This commit is contained in:
parent
1f4852e551
commit
c2158063c1
|
@ -162,7 +162,7 @@ func NewBoard(ctx context.Context, board *Board) error {
|
|||
return err
|
||||
}
|
||||
if maxSorting > 0 {
|
||||
board.Sorting = maxSorting
|
||||
board.Sorting = maxSorting + 1
|
||||
}
|
||||
|
||||
_, err := db.GetEngine(ctx).Insert(board)
|
||||
|
|
|
@ -383,6 +383,10 @@ func UpdateIssueProject(ctx *context.Context) {
|
|||
ctx.ServerError("LoadProjects", err)
|
||||
return
|
||||
}
|
||||
if _, err := issues.LoadRepositories(ctx); err != nil {
|
||||
ctx.ServerError("LoadProjects", err)
|
||||
return
|
||||
}
|
||||
|
||||
projectID := ctx.FormInt64("id")
|
||||
var dstColumnID int64
|
||||
|
@ -392,6 +396,12 @@ func UpdateIssueProject(ctx *context.Context) {
|
|||
ctx.ServerError("GetProjectByID", err)
|
||||
return
|
||||
}
|
||||
for _, issue := range issues {
|
||||
if dstProject.RepoID != ctx.Repo.Repository.ID && dstProject.OwnerID != issue.Repo.OwnerID {
|
||||
ctx.Error(http.StatusBadRequest, "project doesn't belong to the repository")
|
||||
return
|
||||
}
|
||||
}
|
||||
dstDefaultColumn, err := dstProject.GetDefaultBoard(ctx)
|
||||
if err != nil {
|
||||
ctx.ServerError("GetDefaultBoard", err)
|
||||
|
|
|
@ -1339,6 +1339,10 @@ func CompareAndPullRequestPost(ctx *context.Context) {
|
|||
ctx.ServerError("GetProjectByID", err)
|
||||
return
|
||||
}
|
||||
if dstProject.RepoID != ctx.Repo.Repository.ID && dstProject.OwnerID != repo.OwnerID {
|
||||
ctx.Error(http.StatusBadRequest, "project doesn't belong to the repository")
|
||||
return
|
||||
}
|
||||
dstDefaultColumn, err := dstProject.GetDefaultBoard(ctx)
|
||||
if err != nil {
|
||||
ctx.ServerError("GetDefaultBoard", err)
|
||||
|
|
Loading…
Reference in New Issue