File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -273,6 +273,14 @@ func mustAllowPulls(ctx *context.Context) {
273
273
}
274
274
}
275
275
276
+ func mustEnableIssuesOrPulls (ctx * context.Context ) {
277
+ if ! ctx .Repo .Repository .UnitEnabled (models .UnitTypeIssues ) &&
278
+ ! ctx .Repo .Repository .AllowsPulls () {
279
+ ctx .Status (404 )
280
+ return
281
+ }
282
+ }
283
+
276
284
// RegisterRoutes registers all v1 APIs routes to web application.
277
285
// FIXME: custom form error response
278
286
func RegisterRoutes (m * macaron.Macaron ) {
@@ -447,7 +455,7 @@ func RegisterRoutes(m *macaron.Macaron) {
447
455
Post (reqToken (), bind (api.AddTimeOption {}), repo .AddTime )
448
456
})
449
457
})
450
- }, mustEnableIssues )
458
+ }, mustEnableIssuesOrPulls )
451
459
m .Group ("/labels" , func () {
452
460
m .Combo ("" ).Get (repo .ListLabels ).
453
461
Post (reqToken (), bind (api.CreateLabelOption {}), repo .CreateLabel )
You can’t perform that action at this time.
0 commit comments