summaryrefslogtreecommitdiffstats
path: root/models/repo.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2023-05-06 17:39:06 +0800
committerGitHub <noreply@github.com>2023-05-06 17:39:06 +0800
commite5a8ebc0ed2553a16bac4b54a74cc3e5e8036b32 (patch)
treec26686d3793d3908c9f55a11be242103ff1ea04b /models/repo.go
parent0ebabf3c6b12a0c3fe8f54398b4bb5a1d2cbeebf (diff)
downloadgitea-e5a8ebc0ed2553a16bac4b54a74cc3e5e8036b32.tar.gz
gitea-e5a8ebc0ed2553a16bac4b54a74cc3e5e8036b32.zip
Require at least one unit to be enabled (#24189)
Don't remember why the previous decision that `Code` and `Release` are non-disable units globally. Since now every unit include `Code` could be disabled, maybe we should have a new rule that the repo should have at least one unit. So any unit could be disabled. Fixes #20960 Fixes #7525 --------- Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: yp05327 <576951401@qq.com>
Diffstat (limited to 'models/repo.go')
-rw-r--r--models/repo.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/models/repo.go b/models/repo.go
index 5a1e2e028e..d2a3311c8b 100644
--- a/models/repo.go
+++ b/models/repo.go
@@ -40,7 +40,9 @@ var ItemsPerPage = 40
// Init initialize model
func Init(ctx context.Context) error {
- unit.LoadUnitConfig()
+ if err := unit.LoadUnitConfig(); err != nil {
+ return err
+ }
return system_model.Init(ctx)
}