1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-27 04:38:36 +00:00

Fix migration v111 (#12868)

This commit is contained in:
Lunny Xiao
2020-09-16 15:37:04 +08:00
committed by GitHub
parent 3a02f0896e
commit 62a3c847cd
2 changed files with 43 additions and 17 deletions

View File

@@ -110,7 +110,8 @@ func (r *Review) LoadReviewer() error {
return r.loadReviewer(x)
}
func (r *Review) loadAttributes(e Engine) (err error) {
// LoadAttributesX loads all attributes except CodeComments with an Engine parameter
func (r *Review) LoadAttributesX(e Engine) (err error) {
if err = r.loadIssue(e); err != nil {
return
}
@@ -125,7 +126,7 @@ func (r *Review) loadAttributes(e Engine) (err error) {
// LoadAttributes loads all attributes except CodeComments
func (r *Review) LoadAttributes() error {
return r.loadAttributes(x)
return r.LoadAttributesX(x)
}
func getReviewByID(e Engine, id int64) (*Review, error) {
@@ -203,6 +204,12 @@ func IsOfficialReviewer(issue *Issue, reviewer *User) (bool, error) {
return isOfficialReviewer(x, issue, reviewer)
}
// IsOfficialReviewerX check if reviewer can make official reviews in issue (counts towards required approvals)
// with an Engine parameter
func IsOfficialReviewerX(e Engine, issue *Issue, reviewer *User) (bool, error) {
return isOfficialReviewer(x, issue, reviewer)
}
func isOfficialReviewer(e Engine, issue *Issue, reviewer *User) (bool, error) {
pr, err := getPullRequestByIssueID(e, issue.ID)
if err != nil {