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