mirror of
https://github.com/go-gitea/gitea
synced 2024-11-25 06:12:49 +01:00
fix lints
This commit is contained in:
parent
19b2b7c665
commit
78c9d4c2ee
2 changed files with 5 additions and 3 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
// __ __ ___. .__ __
|
// __ __ ___. .__ __
|
||||||
|
|
Loading…
Reference in a new issue