@@ -12,7 +12,6 @@ import (
12
12
"time"
13
13
14
14
"code.gitea.io/gitea/models"
15
- "code.gitea.io/gitea/models/unit"
16
15
unit_model "code.gitea.io/gitea/models/unit"
17
16
"code.gitea.io/gitea/modules/context"
18
17
"code.gitea.io/gitea/modules/convert"
@@ -791,10 +790,10 @@ func updateRepoUnits(ctx *context.APIContext, opts api.EditRepoOption) error {
791
790
})
792
791
deleteUnitTypes = append (deleteUnitTypes , unit_model .TypeExternalTracker )
793
792
} else if ! * opts .HasIssues {
794
- if ! unit .TypeExternalTracker .UnitGlobalDisabled () {
793
+ if ! unit_model .TypeExternalTracker .UnitGlobalDisabled () {
795
794
deleteUnitTypes = append (deleteUnitTypes , unit_model .TypeExternalTracker )
796
795
}
797
- if ! unit .TypeIssues .UnitGlobalDisabled () {
796
+ if ! unit_model .TypeIssues .UnitGlobalDisabled () {
798
797
deleteUnitTypes = append (deleteUnitTypes , unit_model .TypeIssues )
799
798
}
800
799
}
@@ -892,19 +891,19 @@ func updateRepoUnits(ctx *context.APIContext, opts api.EditRepoOption) error {
892
891
Type : unit_model .TypePullRequests ,
893
892
Config : config ,
894
893
})
895
- } else if ! * opts .HasPullRequests && ! unit .TypePullRequests .UnitGlobalDisabled () {
896
- deleteUnitTypes = append (deleteUnitTypes , unit .TypePullRequests )
894
+ } else if ! * opts .HasPullRequests && ! unit_model .TypePullRequests .UnitGlobalDisabled () {
895
+ deleteUnitTypes = append (deleteUnitTypes , unit_model .TypePullRequests )
897
896
}
898
897
}
899
898
900
- if opts .HasProjects != nil && ! unit .TypeProjects .UnitGlobalDisabled () {
899
+ if opts .HasProjects != nil && ! unit_model .TypeProjects .UnitGlobalDisabled () {
901
900
if * opts .HasProjects {
902
901
units = append (units , models.RepoUnit {
903
902
RepoID : repo .ID ,
904
- Type : unit .TypeProjects ,
903
+ Type : unit_model .TypeProjects ,
905
904
})
906
905
} else {
907
- deleteUnitTypes = append (deleteUnitTypes , unit .TypeProjects )
906
+ deleteUnitTypes = append (deleteUnitTypes , unit_model .TypeProjects )
908
907
}
909
908
}
910
909
0 commit comments