ソースを参照

remove stopTimerIfAvailable

pull/30715/head
Zettat123 1ヶ月前
コミット
802efa342d
2個のファイルの変更0行の追加24行の削除
  1. 0
    7
      routers/web/repo/issue.go
  2. 0
    17
      routers/web/repo/pull.go

+ 0
- 7
routers/web/repo/issue.go ファイルの表示

} }
return return
} }
} else {
if err := stopTimerIfAvailable(ctx, ctx.Doer, issue); err != nil {
ctx.ServerError("CreateOrStopIssueStopwatch", err)
return
}

log.Trace("Issue [%d] status changed to closed: %v", issue.ID, issue.IsClosed)
} }
} }
} }

+ 0
- 17
routers/web/repo/pull.go ファイルの表示

} }
log.Trace("Pull request merged: %d", pr.ID) log.Trace("Pull request merged: %d", pr.ID)


if err := stopTimerIfAvailable(ctx, ctx.Doer, issue); err != nil {
ctx.ServerError("stopTimerIfAvailable", err)
return
}

log.Trace("Pull request merged: %d", pr.ID)

if form.DeleteBranchAfterMerge { if form.DeleteBranchAfterMerge {
// Don't cleanup when other pr use this branch as head branch // Don't cleanup when other pr use this branch as head branch
exist, err := issues_model.HasUnmergedPullRequestsByHeadInfo(ctx, pr.HeadRepoID, pr.HeadBranch) exist, err := issues_model.HasUnmergedPullRequestsByHeadInfo(ctx, pr.HeadRepoID, pr.HeadBranch)
ctx.Redirect(fmt.Sprintf("%s/pulls/%d", ctx.Repo.RepoLink, issue.Index)) ctx.Redirect(fmt.Sprintf("%s/pulls/%d", ctx.Repo.RepoLink, issue.Index))
} }


func stopTimerIfAvailable(ctx *context.Context, user *user_model.User, issue *issues_model.Issue) error {
if issues_model.StopwatchExists(ctx, user.ID, issue.ID) {
if err := issues_model.CreateOrStopIssueStopwatch(ctx, user, issue); err != nil {
return err
}
}

return nil
}

// CompareAndPullRequestPost response for creating pull request // CompareAndPullRequestPost response for creating pull request
func CompareAndPullRequestPost(ctx *context.Context) { func CompareAndPullRequestPost(ctx *context.Context) {
form := web.GetForm(ctx).(*forms.CreateIssueForm) form := web.GetForm(ctx).(*forms.CreateIssueForm)

読み込み中…
キャンセル
保存