diff --git a/models/pull.go b/models/pull.go index 2eb89d2e3..a8b86937a 100755 --- a/models/pull.go +++ b/models/pull.go @@ -407,7 +407,7 @@ func (pr *PullRequest) SetMerged() (bool, error) { return false, fmt.Errorf("Issue.changeStatus: %v", err) } - if _, err := sess.Where("id = ?", pr.ID).Cols("has_merged, status, merged_commit_id, merger_id, merged_unix").Update(pr); err != nil { + if _, err := sess.Where("id = ?", pr.ID).Cols("has_merged, status, merged_commit_id, merger_id, merged_unix, amount").Update(pr); err != nil { return false, fmt.Errorf("Failed to update pr[%d]: %v", pr.ID, err) } diff --git a/models/repo.go b/models/repo.go index 7cda4ce8a..bef634941 100755 --- a/models/repo.go +++ b/models/repo.go @@ -205,7 +205,7 @@ type Repository struct { //blockchain ContractAddress string `xorm:"INDEX"` - Balance int64 `xorm:"NOT NULL DEFAULT 0"` + Balance string `xorm:"NOT NULL DEFAULT '0'"` BlockChainStatus RepoBlockChainStatus `xorm:"NOT NULL DEFAULT 0"` CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` diff --git a/modules/auth/repo_form.go b/modules/auth/repo_form.go index 96d99bfed..7d0e9b439 100755 --- a/modules/auth/repo_form.go +++ b/modules/auth/repo_form.go @@ -489,7 +489,7 @@ type MergePullRequestForm struct { MergeTitleField string MergeMessageField string ForceMerge *bool `json:"force_merge,omitempty"` - BlockChainAmount int `binding:"Required"` + BlockChainAmount int } // Validate validates the fields diff --git a/routers/repo/pull.go b/routers/repo/pull.go index 80864122a..8841e4755 100755 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -816,6 +816,8 @@ func MergePullRequest(ctx *context.Context, form auth.MergePullRequestForm) { return } + pr.Amount = form.BlockChainAmount + if err = pull_service.Merge(pr, ctx.User, ctx.Repo.GitRepo, models.MergeStyle(form.Do), message); err != nil { if models.IsErrInvalidMergeStyle(err) { ctx.Flash.Error(ctx.Tr("repo.pulls.invalid_merge_option"))