Skip to content

Commit 78b7529

Browse files
authored
Fix overdue marking of closed issues and milestones (#14923)
Closed milestones and issues should only be marked overdue if they were closed after their deadline. Fix: #14536 Signed-off-by: Andrew Thornton <[email protected]>
1 parent 09fe0ab commit 78b7529

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

models/issue.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ func (issue *Issue) loadTotalTimes(e Engine) (err error) {
9797

9898
// IsOverdue checks if the issue is overdue
9999
func (issue *Issue) IsOverdue() bool {
100+
if issue.IsClosed {
101+
return issue.ClosedUnix >= issue.DeadlineUnix
102+
}
100103
return timeutil.TimeStampNow() >= issue.DeadlineUnix
101104
}
102105

models/issue_milestone.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ func (m *Milestone) AfterLoad() {
6363
}
6464

6565
m.DeadlineString = m.DeadlineUnix.Format("2006-01-02")
66-
if timeutil.TimeStampNow() >= m.DeadlineUnix {
67-
m.IsOverdue = true
66+
if m.IsClosed {
67+
m.IsOverdue = m.ClosedDateUnix >= m.DeadlineUnix
68+
} else {
69+
m.IsOverdue = timeutil.TimeStampNow() >= m.DeadlineUnix
6870
}
6971
}
7072

0 commit comments

Comments
 (0)