]> source.dussan.org Git - gitea.git/commitdiff
Fix a bug when check if owner is active (#13614)
authorLunny Xiao <xiaolunwen@gmail.com>
Wed, 18 Nov 2020 09:59:54 +0000 (17:59 +0800)
committerGitHub <noreply@github.com>
Wed, 18 Nov 2020 09:59:54 +0000 (11:59 +0200)
routers/private/serv.go
routers/repo/http.go

index eba431785b94fa4c0179ddecfef844edd3e52887..b6dd2c361e012faedb7904fcc0c81873a5581f6c 100644 (file)
@@ -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",
index 8cb4827f48fa740acd89956d3f82a9dc31c9f2f2..a1dcd65e1f5a047f2f57ed05e203840473010de6 100644 (file)
@@ -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
        }