@@ -11,7 +11,6 @@ import (
1111 access_model "code.gitea.io/gitea/models/perm/access"
1212 repo_model "code.gitea.io/gitea/models/repo"
1313 user_model "code.gitea.io/gitea/models/user"
14- "code.gitea.io/gitea/modules/setting"
1514 api "code.gitea.io/gitea/modules/structs"
1615 "code.gitea.io/gitea/routers/api/v1/utils"
1716 "code.gitea.io/gitea/services/context"
@@ -70,11 +69,6 @@ func GetStarredRepos(ctx *context.APIContext) {
7069 // "403":
7170 // "$ref": "#/responses/forbidden"
7271
73- if setting .Repository .DisableStars {
74- ctx .Error (http .StatusForbidden , "StarsDisabled" , "Stars are disabled." )
75- return
76- }
77-
7872 private := ctx .ContextUser .ID == ctx .Doer .ID
7973 repos , err := getStarredRepos (ctx , ctx .ContextUser , private )
8074 if err != nil {
@@ -108,11 +102,6 @@ func GetMyStarredRepos(ctx *context.APIContext) {
108102 // "403":
109103 // "$ref": "#/responses/forbidden"
110104
111- if setting .Repository .DisableStars {
112- ctx .Error (http .StatusForbidden , "StarsDisabled" , "Stars are disabled." )
113- return
114- }
115-
116105 repos , err := getStarredRepos (ctx , ctx .Doer , true )
117106 if err != nil {
118107 ctx .Error (http .StatusInternalServerError , "getStarredRepos" , err )
@@ -146,11 +135,6 @@ func IsStarring(ctx *context.APIContext) {
146135 // "403":
147136 // "$ref": "#/responses/forbidden"
148137
149- if setting .Repository .DisableStars {
150- ctx .Error (http .StatusForbidden , "StarsDisabled" , "Stars are disabled." )
151- return
152- }
153-
154138 if repo_model .IsStaring (ctx , ctx .Doer .ID , ctx .Repo .Repository .ID ) {
155139 ctx .Status (http .StatusNoContent )
156140 } else {
@@ -182,11 +166,6 @@ func Star(ctx *context.APIContext) {
182166 // "404":
183167 // "$ref": "#/responses/notFound"
184168
185- if setting .Repository .DisableStars {
186- ctx .Error (http .StatusForbidden , "StarsDisabled" , "Stars are disabled." )
187- return
188- }
189-
190169 err := repo_model .StarRepo (ctx , ctx .Doer , ctx .Repo .Repository , true )
191170 if err != nil {
192171 if errors .Is (err , user_model .ErrBlockedUser ) {
@@ -223,11 +202,6 @@ func Unstar(ctx *context.APIContext) {
223202 // "403":
224203 // "$ref": "#/responses/forbidden"
225204
226- if setting .Repository .DisableStars {
227- ctx .Error (http .StatusForbidden , "StarsDisabled" , "Stars are disabled." )
228- return
229- }
230-
231205 err := repo_model .StarRepo (ctx , ctx .Doer , ctx .Repo .Repository , false )
232206 if err != nil {
233207 ctx .Error (http .StatusInternalServerError , "StarRepo" , err )
0 commit comments