mirror of
https://github.com/go-gitea/gitea.git
synced 2026-02-13 12:59:00 +01:00
cleanup
This commit is contained in:
parent
9faf677652
commit
13660f202d
@ -95,7 +95,7 @@ func (p *Permission) UnitAccessMode(unitType unit.Type) perm_model.AccessMode {
|
||||
if m, ok := p.unitsMode[unitType]; ok {
|
||||
return util.Iif(p.AccessMode >= perm_model.AccessModeAdmin, p.AccessMode, m)
|
||||
}
|
||||
// If the units map does not contain the access mode, return the default access mode if the unit exists
|
||||
// if the units map does not contain the access mode, return the default access mode if the unit exists
|
||||
unitDefaultAccessMode := p.AccessMode
|
||||
unitDefaultAccessMode = max(unitDefaultAccessMode, p.anonymousAccessMode[unitType])
|
||||
unitDefaultAccessMode = max(unitDefaultAccessMode, p.everyoneAccessMode[unitType])
|
||||
|
||||
@ -712,7 +712,6 @@ jobs:
|
||||
require.NoError(t, db.Insert(t.Context(), job))
|
||||
|
||||
// 3. Change Repo Settings to RESTRICTED
|
||||
// We need to update the RepoUnit config
|
||||
unitConfig := &repo_model.ActionsConfig{
|
||||
TokenPermissionMode: repo_model.ActionsTokenPermissionModeRestricted,
|
||||
}
|
||||
@ -727,11 +726,6 @@ jobs:
|
||||
require.NoError(t, repo_model.UpdateRepoUnit(t.Context(), unit))
|
||||
|
||||
// 4. Trigger Rerun via Web Handler
|
||||
// POST /:username/:reponame/actions/runs/:index/rerun
|
||||
// We need to know operation run index. Since it's the first run, it should be 1?
|
||||
// ActionRun.Index is auto-increment but not set in my insert.
|
||||
// Ideally we use CreateRun which handles index.
|
||||
// Let's manually set index 1.
|
||||
run.Index = 1
|
||||
_, err = db.GetEngine(t.Context()).ID(run.ID).Cols("index").Update(run)
|
||||
require.NoError(t, err)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user