diff --git a/pkg/models/subscription.go b/pkg/models/subscription.go index 6251df18d..f8dc1710f 100644 --- a/pkg/models/subscription.go +++ b/pkg/models/subscription.go @@ -83,6 +83,10 @@ func (et SubscriptionEntityType) validate() error { return &ErrUnknownSubscriptionEntityType{EntityType: et} } +// Returns a matching subscription for an entity and user. +// It will return the next parent of a subscription. That means for tasks, it will first look for a subscription for +// that task, if there is none it will look for a subscription on the list the task belongs to and if that also +// doesn't exist it will check for a subscription for the namespace the list is belonging to. func getSubscription(s *xorm.Session, entityType SubscriptionEntityType, a web.Auth, entityID int64) (subscription *Subscription, err error) { u, is := a.(*user.User) if !is {