forked from forgejo/forgejo
Move unit into models/unit/ (#17576)
* Move unit into models/unit/ * Rename unit.UnitType as unit.Type
This commit is contained in:
parent
b6b1e71665
commit
99b2858e62
68 changed files with 556 additions and 491 deletions
|
@ -10,6 +10,7 @@ import (
|
|||
"time"
|
||||
|
||||
"code.gitea.io/gitea/models"
|
||||
"code.gitea.io/gitea/models/unit"
|
||||
"code.gitea.io/gitea/modules/context"
|
||||
"code.gitea.io/gitea/modules/convert"
|
||||
api "code.gitea.io/gitea/modules/structs"
|
||||
|
@ -108,7 +109,7 @@ func ListTrackedTimes(ctx *context.APIContext) {
|
|||
|
||||
cantSetUser := !ctx.User.IsAdmin &&
|
||||
opts.UserID != ctx.User.ID &&
|
||||
!ctx.IsUserRepoWriter([]models.UnitType{models.UnitTypeIssues})
|
||||
!ctx.IsUserRepoWriter([]unit.Type{unit.TypeIssues})
|
||||
|
||||
if cantSetUser {
|
||||
if opts.UserID == 0 {
|
||||
|
@ -527,7 +528,7 @@ func ListTrackedTimesByRepository(ctx *context.APIContext) {
|
|||
|
||||
cantSetUser := !ctx.User.IsAdmin &&
|
||||
opts.UserID != ctx.User.ID &&
|
||||
!ctx.IsUserRepoWriter([]models.UnitType{models.UnitTypeIssues})
|
||||
!ctx.IsUserRepoWriter([]unit.Type{unit.TypeIssues})
|
||||
|
||||
if cantSetUser {
|
||||
if opts.UserID == 0 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue