From bcde51f4c27589392b7e58da68cd0228936dbeff Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 18 Nov 2020 17:59:24 +0800 Subject: [PATCH] Fix a bug when check if owner is active (#13613) --- routers/private/serv.go | 2 +- routers/repo/http.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/routers/private/serv.go b/routers/private/serv.go index 2697666b8..182fe2724 100644 --- a/routers/private/serv.go +++ b/routers/private/serv.go @@ -114,7 +114,7 @@ func ServCommand(ctx *macaron.Context) { }) return } - if !owner.IsActive { + if !owner.IsOrganization() && !owner.IsActive { ctx.JSON(http.StatusForbidden, map[string]interface{}{ "results": results, "type": "ForbiddenError", diff --git a/routers/repo/http.go b/routers/repo/http.go index 1de5dd9a9..9be0e6e3b 100644 --- a/routers/repo/http.go +++ b/routers/repo/http.go @@ -105,7 +105,7 @@ func HTTP(ctx *context.Context) { ctx.NotFoundOrServerError("GetUserByName", models.IsErrUserNotExist, err) return } - if !owner.IsActive { + if !owner.IsOrganization() && !owner.IsActive { ctx.HandleText(http.StatusForbidden, "Repository cannot be accessed. You cannot push or open issues/pull-requests.") return }