mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 10:18:38 +00:00
Rename GetUnits
to LoadUnits
(#22970)
Same as https://github.com/go-gitea/gitea/pull/22967 --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
@@ -111,12 +111,8 @@ func (t *Team) ColorFormat(s fmt.State) {
|
||||
t.AccessMode)
|
||||
}
|
||||
|
||||
// GetUnits return a list of available units for a team
|
||||
func (t *Team) GetUnits() error {
|
||||
return t.getUnits(db.DefaultContext)
|
||||
}
|
||||
|
||||
func (t *Team) getUnits(ctx context.Context) (err error) {
|
||||
// LoadUnits load a list of available units for a team
|
||||
func (t *Team) LoadUnits(ctx context.Context) (err error) {
|
||||
if t.Units != nil {
|
||||
return nil
|
||||
}
|
||||
@@ -193,7 +189,7 @@ func (t *Team) UnitEnabled(ctx context.Context, tp unit.Type) bool {
|
||||
|
||||
// UnitAccessMode returns if the team has the given unit type enabled
|
||||
func (t *Team) UnitAccessMode(ctx context.Context, tp unit.Type) perm.AccessMode {
|
||||
if err := t.getUnits(ctx); err != nil {
|
||||
if err := t.LoadUnits(ctx); err != nil {
|
||||
log.Warn("Error loading team (ID: %d) units: %s", t.ID, err.Error())
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user