0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-29 00:17:47 +01:00

fix lints

This commit is contained in:
6543 2024-10-21 21:21:17 +02:00
parent 19b2b7c665
commit 78c9d4c2ee
2 changed files with 5 additions and 3 deletions

View file

@ -417,10 +417,12 @@ func UpdateProtectBranch(ctx context.Context, repo *repo_model.Repository, prote
// as it's a new rule and if priority was not set, we need to calc it. // as it's a new rule and if priority was not set, we need to calc it.
if protectBranch.Priority == 0 { if protectBranch.Priority == 0 {
var lowestPrio int64 var lowestPrio int64
db.GetEngine(ctx).Table(protectBranch). if _, err := db.GetEngine(ctx).Table(protectBranch).
Select("MAX(priority)"). Select("MAX(priority)").
Where("repo_id = ?", protectBranch.RepoID). Where("repo_id = ?", protectBranch.RepoID).
Get(&lowestPrio) Get(&lowestPrio); err != nil {
return err
}
log.Trace("Create new ProtectedBranch at repo[%d] and detect current lowest priority '%d'", protectBranch.RepoID, lowestPrio) log.Trace("Create new ProtectedBranch at repo[%d] and detect current lowest priority '%d'", protectBranch.RepoID, lowestPrio)
protectBranch.Priority = lowestPrio + 1 protectBranch.Priority = lowestPrio + 1
} }

View file

@ -228,7 +228,7 @@ func (f *ProtectBranchForm) Validate(req *http.Request, errs binding.Errors) bin
} }
type ProtectBranchPriorityForm struct { type ProtectBranchPriorityForm struct {
IDS []int64 IDs []int64
} }
// __ __ ___. .__ __ // __ __ ___. .__ __