From 449ea6005fb613212102126ff267f5c16f7c40b8 Mon Sep 17 00:00:00 2001
From: zeripath <art27@cantab.net>
Date: Sat, 4 Jun 2022 19:30:01 +0100
Subject: [PATCH] Exclude Archived repos from Dashboard Milestones (#19882)

Milestones in archived repos should not be displayed on `/milestones`. Therefore
we should exclude these repositories from milestones page.

Fix #18257

Signed-off-by: Andrew Thornton <art27@cantab.net>
---
 models/fixtures/repository.yml | 3 ++-
 routers/web/user/home.go       | 5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/models/fixtures/repository.yml b/models/fixtures/repository.yml
index 450c2f26a..82b3ed16d 100644
--- a/models/fixtures/repository.yml
+++ b/models/fixtures/repository.yml
@@ -618,7 +618,8 @@
   num_forks: 0
   num_issues: 1
   num_milestones: 1
-  is_mirror: false
+  is_mirror:
+  is_archived: false
 
 -
   id: 43
diff --git a/routers/web/user/home.go b/routers/web/user/home.go
index 455761d03..297d76d4a 100644
--- a/routers/web/user/home.go
+++ b/routers/web/user/home.go
@@ -170,8 +170,9 @@ func Milestones(ctx *context.Context) {
 		Actor:         ctxUser,
 		OwnerID:       ctxUser.ID,
 		Private:       true,
-		AllPublic:     false,                 // Include also all public repositories of users and public organisations
-		AllLimited:    false,                 // Include also all public repositories of limited organisations
+		AllPublic:     false, // Include also all public repositories of users and public organisations
+		AllLimited:    false, // Include also all public repositories of limited organisations
+		Archived:      util.OptionalBoolFalse,
 		HasMilestones: util.OptionalBoolTrue, // Just needs display repos has milestones
 	}