fix(filter): don't try to get the real subscription for a saved filter project

This commit is contained in:
kolaente 2023-06-07 20:41:59 +02:00
parent 4ed2d305f0
commit ebfb3f9aaa
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 9 additions and 3 deletions

View File

@ -209,8 +209,10 @@ func (p *Project) ReadOne(s *xorm.Session, a web.Auth) (err error) {
}
// Check for saved filters
if getSavedFilterIDFromProjectID(p.ID) > 0 {
sf, err := getSavedFilterSimpleByID(s, getSavedFilterIDFromProjectID(p.ID))
filterID := getSavedFilterIDFromProjectID(p.ID)
isFilter := filterID > 0
if isFilter {
sf, err := getSavedFilterSimpleByID(s, filterID)
if err != nil {
return err
}
@ -228,7 +230,7 @@ func (p *Project) ReadOne(s *xorm.Session, a web.Auth) (err error) {
}
// Check if the project is archived and set it to archived if it is not already archived individually.
if !p.IsArchived {
if !p.IsArchived && !isFilter {
err = p.CheckIsArchived(s)
if err != nil {
p.IsArchived = true
@ -254,6 +256,10 @@ func (p *Project) ReadOne(s *xorm.Session, a web.Auth) (err error) {
}
p.Subscription, err = GetSubscription(s, SubscriptionEntityProject, p.ID, a)
if err != nil && IsErrProjectDoesNotExist(err) && isFilter {
return nil
}
return
}