@@ -12,7 +12,6 @@ import (
1212 "time"
1313
1414 "code.gitea.io/gitea/models"
15- "code.gitea.io/gitea/models/unit"
1615 unit_model "code.gitea.io/gitea/models/unit"
1716 "code.gitea.io/gitea/modules/context"
1817 "code.gitea.io/gitea/modules/convert"
@@ -791,10 +790,10 @@ func updateRepoUnits(ctx *context.APIContext, opts api.EditRepoOption) error {
791790 })
792791 deleteUnitTypes = append (deleteUnitTypes , unit_model .TypeExternalTracker )
793792 } else if ! * opts .HasIssues {
794- if ! unit .TypeExternalTracker .UnitGlobalDisabled () {
793+ if ! unit_model .TypeExternalTracker .UnitGlobalDisabled () {
795794 deleteUnitTypes = append (deleteUnitTypes , unit_model .TypeExternalTracker )
796795 }
797- if ! unit .TypeIssues .UnitGlobalDisabled () {
796+ if ! unit_model .TypeIssues .UnitGlobalDisabled () {
798797 deleteUnitTypes = append (deleteUnitTypes , unit_model .TypeIssues )
799798 }
800799 }
@@ -892,19 +891,19 @@ func updateRepoUnits(ctx *context.APIContext, opts api.EditRepoOption) error {
892891 Type : unit_model .TypePullRequests ,
893892 Config : config ,
894893 })
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 )
897896 }
898897 }
899898
900- if opts .HasProjects != nil && ! unit .TypeProjects .UnitGlobalDisabled () {
899+ if opts .HasProjects != nil && ! unit_model .TypeProjects .UnitGlobalDisabled () {
901900 if * opts .HasProjects {
902901 units = append (units , models.RepoUnit {
903902 RepoID : repo .ID ,
904- Type : unit .TypeProjects ,
903+ Type : unit_model .TypeProjects ,
905904 })
906905 } else {
907- deleteUnitTypes = append (deleteUnitTypes , unit .TypeProjects )
906+ deleteUnitTypes = append (deleteUnitTypes , unit_model .TypeProjects )
908907 }
909908 }
910909
0 commit comments