Signed-off-by: pengqiseven <912170095@qq.com>tags/v1.22.0-rc0
If the template fails to render, it will be noticed only at the moment the mail is sent. | If the template fails to render, it will be noticed only at the moment the mail is sent. | ||||
A default subject is used if the subject template fails, and whatever was rendered successfully | A default subject is used if the subject template fails, and whatever was rendered successfully | ||||
from the the _mail body_ is used, disregarding the rest. | |||||
from the _mail body_ is used, disregarding the rest. | |||||
Please check [Gitea's logs](administration/logging-config.md) for error messages in case of trouble. | Please check [Gitea's logs](administration/logging-config.md) for error messages in case of trouble. | ||||
func applyReviewedCondition(sess *xorm.Session, reviewedID int64) *xorm.Session { | func applyReviewedCondition(sess *xorm.Session, reviewedID int64) *xorm.Session { | ||||
// Query for pull requests where you are a reviewer or commenter, excluding | // Query for pull requests where you are a reviewer or commenter, excluding | ||||
// any pull requests already returned by the the review requested filter. | |||||
// any pull requests already returned by the review requested filter. | |||||
notPoster := builder.Neq{"issue.poster_id": reviewedID} | notPoster := builder.Neq{"issue.poster_id": reviewedID} | ||||
reviewed := builder.In("issue.id", builder. | reviewed := builder.In("issue.id", builder. | ||||
Select("issue_id"). | Select("issue_id"). |
return u.Name | return u.Name | ||||
} | } | ||||
// GetCompleteName returns the the full name and username in the form of | |||||
// GetCompleteName returns the full name and username in the form of | |||||
// "Full Name (username)" if full name is not empty, otherwise it returns | // "Full Name (username)" if full name is not empty, otherwise it returns | ||||
// "username". | // "username". | ||||
func (u *User) GetCompleteName() string { | func (u *User) GetCompleteName() string { |
return c.repo.GetFilesChangedBetween(pastCommit, c.ID.String()) | return c.repo.GetFilesChangedBetween(pastCommit, c.ID.String()) | ||||
} | } | ||||
// FileChangedSinceCommit Returns true if the file given has changed since the the past commit | |||||
// FileChangedSinceCommit Returns true if the file given has changed since the past commit | |||||
// YOU MUST ENSURE THAT pastCommit is a valid commit ID. | // YOU MUST ENSURE THAT pastCommit is a valid commit ID. | ||||
func (c *Commit) FileChangedSinceCommit(filename, pastCommit string) (bool, error) { | func (c *Commit) FileChangedSinceCommit(filename, pastCommit string) (bool, error) { | ||||
return c.repo.FileChangedBetweenCommits(filename, pastCommit, c.ID.String()) | return c.repo.FileChangedBetweenCommits(filename, pastCommit, c.ID.String()) |
// required: false | // required: false | ||||
// - name: created_by | // - name: created_by | ||||
// in: query | // in: query | ||||
// description: Only show items which were created by the the given user | |||||
// description: Only show items which were created by the given user | |||||
// type: string | // type: string | ||||
// - name: assigned_by | // - name: assigned_by | ||||
// in: query | // in: query |
return nil, nil, true | return nil, nil, true | ||||
} | } | ||||
// validate the the review is for the given PR | |||||
// validate the review is for the given PR | |||||
if review.IssueID != pr.IssueID { | if review.IssueID != pr.IssueID { | ||||
ctx.NotFound("ReviewNotInPR") | ctx.NotFound("ReviewNotInPR") | ||||
return nil, nil, true | return nil, nil, true |
}, | }, | ||||
{ | { | ||||
"type": "string", | "type": "string", | ||||
"description": "Only show items which were created by the the given user", | |||||
"description": "Only show items which were created by the given user", | |||||
"name": "created_by", | "name": "created_by", | ||||
"in": "query" | "in": "query" | ||||
}, | }, |