mirror of
https://github.com/go-gitea/gitea
synced 2024-12-22 15:37:54 +01:00
Fix deadline on update issue or PR via API (#8698)
This commit is contained in:
parent
9bde52ffc1
commit
8caf05989f
@ -312,15 +312,14 @@ func EditIssue(ctx *context.APIContext, form api.EditIssueOption) {
|
||||
}
|
||||
|
||||
// Update the deadline
|
||||
var deadlineUnix timeutil.TimeStamp
|
||||
if form.Deadline != nil && !form.Deadline.IsZero() && ctx.Repo.CanWrite(models.UnitTypeIssues) {
|
||||
deadlineUnix = timeutil.TimeStamp(form.Deadline.Unix())
|
||||
}
|
||||
|
||||
if form.Deadline != nil && ctx.Repo.CanWrite(models.UnitTypeIssues) {
|
||||
deadlineUnix := timeutil.TimeStamp(form.Deadline.Unix())
|
||||
if err := models.UpdateIssueDeadline(issue, deadlineUnix, ctx.User); err != nil {
|
||||
ctx.Error(500, "UpdateIssueDeadline", err)
|
||||
return
|
||||
}
|
||||
issue.DeadlineUnix = deadlineUnix
|
||||
}
|
||||
|
||||
// Add/delete assignees
|
||||
|
||||
|
@ -368,15 +368,14 @@ func EditPullRequest(ctx *context.APIContext, form api.EditPullRequestOption) {
|
||||
}
|
||||
|
||||
// Update Deadline
|
||||
var deadlineUnix timeutil.TimeStamp
|
||||
if form.Deadline != nil && !form.Deadline.IsZero() {
|
||||
deadlineUnix = timeutil.TimeStamp(form.Deadline.Unix())
|
||||
}
|
||||
|
||||
if form.Deadline != nil {
|
||||
deadlineUnix := timeutil.TimeStamp(form.Deadline.Unix())
|
||||
if err := models.UpdateIssueDeadline(issue, deadlineUnix, ctx.User); err != nil {
|
||||
ctx.Error(500, "UpdateIssueDeadline", err)
|
||||
return
|
||||
}
|
||||
issue.DeadlineUnix = deadlineUnix
|
||||
}
|
||||
|
||||
// Add/delete assignees
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user