summaryrefslogtreecommitdiffstats
path: root/models/repo_issue.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-11-10 03:57:58 +0800
committerGitHub <noreply@github.com>2021-11-09 20:57:58 +0100
commit99b2858e628d92bba252be72def409af77af735b (patch)
tree56159cf10b271307911e6f01626c0c3efba789ab /models/repo_issue.go
parentb6b1e716654fec3b16d245ef65cf42e57e1bb5b6 (diff)
downloadgitea-99b2858e628d92bba252be72def409af77af735b.tar.gz
gitea-99b2858e628d92bba252be72def409af77af735b.zip
Move unit into models/unit/ (#17576)
* Move unit into models/unit/ * Rename unit.UnitType as unit.Type
Diffstat (limited to 'models/repo_issue.go')
-rw-r--r--models/repo_issue.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/models/repo_issue.go b/models/repo_issue.go
index 433d0e39bd..32bfdc15b6 100644
--- a/models/repo_issue.go
+++ b/models/repo_issue.go
@@ -4,7 +4,10 @@
package models
-import "code.gitea.io/gitea/modules/setting"
+import (
+ "code.gitea.io/gitea/models/unit"
+ "code.gitea.io/gitea/modules/setting"
+)
// ___________.__ ___________ __
// \__ ___/|__| _____ ___\__ ___/___________ ____ | | __ ___________
@@ -27,7 +30,7 @@ func (repo *Repository) IsTimetrackerEnabled() bool {
var u *RepoUnit
var err error
- if u, err = repo.GetUnit(UnitTypeIssues); err != nil {
+ if u, err = repo.GetUnit(unit.TypeIssues); err != nil {
return setting.Service.DefaultEnableTimetracking
}
return u.IssuesConfig().EnableTimetracker
@@ -37,7 +40,7 @@ func (repo *Repository) IsTimetrackerEnabled() bool {
func (repo *Repository) AllowOnlyContributorsToTrackTime() bool {
var u *RepoUnit
var err error
- if u, err = repo.GetUnit(UnitTypeIssues); err != nil {
+ if u, err = repo.GetUnit(unit.TypeIssues); err != nil {
return setting.Service.DefaultAllowOnlyContributorsToTrackTime
}
return u.IssuesConfig().AllowOnlyContributorsToTrackTime