summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/pull.go
diff options
context:
space:
mode:
Diffstat (limited to 'routers/api/v1/repo/pull.go')
-rw-r--r--routers/api/v1/repo/pull.go15
1 files changed, 7 insertions, 8 deletions
diff --git a/routers/api/v1/repo/pull.go b/routers/api/v1/repo/pull.go
index 6b20844c51..77fb452938 100644
--- a/routers/api/v1/repo/pull.go
+++ b/routers/api/v1/repo/pull.go
@@ -392,14 +392,13 @@ 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 err := models.UpdateIssueDeadline(issue, deadlineUnix, ctx.User); err != nil {
- ctx.Error(500, "UpdateIssueDeadline", err)
- return
+ 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