mirror of
https://github.com/go-gitea/gitea
synced 2025-08-12 12:38:20 +00:00
* Fix PR, milestone and label functionality if issue unit is disabled or not assigned to user * Fix multi-actions in PR page * Change error message * Fix comment update and delete functionality in PR
This commit is contained in:
@@ -409,6 +409,21 @@ func (repo *Repository) UnitEnabled(tp UnitType) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// AnyUnitEnabled if this repository has the any of the given units enabled
|
||||
func (repo *Repository) AnyUnitEnabled(tps ...UnitType) bool {
|
||||
if err := repo.getUnits(x); err != nil {
|
||||
log.Warn("Error loading repository (ID: %d) units: %s", repo.ID, err.Error())
|
||||
}
|
||||
for _, unit := range repo.Units {
|
||||
for _, tp := range tps {
|
||||
if unit.Type == tp {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var (
|
||||
// ErrUnitNotExist organization does not exist
|
||||
ErrUnitNotExist = errors.New("Unit does not exist")
|
||||
|
Reference in New Issue
Block a user