}
// 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
}
// 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