From 674c5c37be53665db8ce549ece51c24129e695d9 Mon Sep 17 00:00:00 2001 From: Martin Hartkorn Date: Wed, 27 Jan 2016 22:45:03 +0100 Subject: Change user name in Pull Requests --- models/pull.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'models/pull.go') diff --git a/models/pull.go b/models/pull.go index 8497285e..2fe7d1fe 100644 --- a/models/pull.go +++ b/models/pull.go @@ -525,6 +525,14 @@ func AddTestPullRequestTask(repoID int64, branch string) { } } +func ChangeUsernameInPullRequests(oldUserName, newUserName string) (error) { + pr := PullRequest{ + HeadUserName : newUserName, + } + _, err := x.Cols("head_user_name").Where("head_user_name = ?", oldUserName).Update(pr) + return err +} + // checkAndUpdateStatus checks if pull request is possible to levaing checking status, // and set to be either conflict or mergeable. func (pr *PullRequest) checkAndUpdateStatus() { -- cgit v1.2.3