summaryrefslogtreecommitdiffstats
path: root/models/repo_issue.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/repo_issue.go')
-rw-r--r--models/repo_issue.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/models/repo_issue.go b/models/repo_issue.go
index 10356d2c98..433d0e39bd 100644
--- a/models/repo_issue.go
+++ b/models/repo_issue.go
@@ -13,8 +13,18 @@ import "code.gitea.io/gitea/modules/setting"
// |____| |__|__|_| /\___ >____| |__| (____ /\___ >__|_ \\___ >__|
// \/ \/ \/ \/ \/ \/
+// CanEnableTimetracker returns true when the server admin enabled time tracking
+// This overrules IsTimetrackerEnabled
+func (repo *Repository) CanEnableTimetracker() bool {
+ return setting.Service.EnableTimetracking
+}
+
// IsTimetrackerEnabled returns whether or not the timetracker is enabled. It returns the default value from config if an error occurs.
func (repo *Repository) IsTimetrackerEnabled() bool {
+ if !setting.Service.EnableTimetracking {
+ return false
+ }
+
var u *RepoUnit
var err error
if u, err = repo.GetUnit(UnitTypeIssues); err != nil {