remove util.OptionalBool and related functions (#29513)
and migrate affected code _last refactoring bits to replace **util.OptionalBool** with **optional.Option[bool]**_
This commit is contained in:
parent
3f081d4b54
commit
a3f05d0d98
71 changed files with 308 additions and 355 deletions
|
@ -18,10 +18,10 @@ import (
|
|||
user_model "code.gitea.io/gitea/models/user"
|
||||
"code.gitea.io/gitea/modules/json"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/optional"
|
||||
packages_module "code.gitea.io/gitea/modules/packages"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/storage"
|
||||
"code.gitea.io/gitea/modules/util"
|
||||
notify_service "code.gitea.io/gitea/services/notify"
|
||||
)
|
||||
|
||||
|
@ -330,7 +330,7 @@ func CheckCountQuotaExceeded(ctx context.Context, doer, owner *user_model.User)
|
|||
if setting.Packages.LimitTotalOwnerCount > -1 {
|
||||
totalCount, err := packages_model.CountVersions(ctx, &packages_model.PackageSearchOptions{
|
||||
OwnerID: owner.ID,
|
||||
IsInternal: util.OptionalBoolFalse,
|
||||
IsInternal: optional.Some(false),
|
||||
})
|
||||
if err != nil {
|
||||
log.Error("CountVersions failed: %v", err)
|
||||
|
@ -640,7 +640,7 @@ func RemoveAllPackages(ctx context.Context, userID int64) (int, error) {
|
|||
Page: 1,
|
||||
},
|
||||
OwnerID: userID,
|
||||
IsInternal: util.OptionalBoolNone,
|
||||
IsInternal: optional.None[bool](),
|
||||
})
|
||||
if err != nil {
|
||||
return count, fmt.Errorf("GetOwnedPackages[%d]: %w", userID, err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue