fix(project): don't allow un-archiving a project when its parent project is archived

This commit is contained in:
kolaente 2023-01-12 16:12:10 +01:00
parent 7f175f7f1a
commit 82bcc726a8
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 2 additions and 1 deletions

View File

@ -147,7 +147,8 @@ func (p *Project) CanUpdate(s *xorm.Session, a web.Auth) (canUpdate bool, err er
canUpdate, err = p.CanWrite(s, a)
// If the project is archived and the user tries to un-archive it, let the request through
if IsErrProjectIsArchived(err) && !p.IsArchived {
archivedErr, is := err.(ErrProjectIsArchived)
if is && !p.IsArchived && archivedErr.ProjectID == p.ID {
err = nil
}
return canUpdate, err