aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLunny Xiao2020-11-18 17:59:54 +0800
committerGitHub2020-11-18 11:59:54 +0200
commit6edd6d5a2485bb22a4cdb8e01015ce6b2f1df4d3 (patch)
tree314b4f5e01e0ad0ac5c8c5935b8b0bbf49eb3596
parentf845fa0ddc4ebf3e36d4cd4335402fca681c15e3 (diff)
Fix a bug when check if owner is active (#13614)
-rw-r--r--routers/private/serv.go2
-rw-r--r--routers/repo/http.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/routers/private/serv.go b/routers/private/serv.go
index eba431785..b6dd2c361 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 8cb4827f4..a1dcd65e1 100644
--- a/routers/repo/http.go
+++ b/routers/repo/http.go
@@ -104,7 +104,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
}