1
0

fix: prevent moving a list into a pseudo namespace

This commit is contained in:
kolaente
2022-08-15 23:25:35 +02:00
parent 8d10130d4c
commit 3ccc6365a6
4 changed files with 62 additions and 10 deletions

View File

@ -543,6 +543,10 @@ func (l *List) CheckIsArchived(s *xorm.Session) (err error) {
}
func checkListBeforeUpdateOrDelete(s *xorm.Session, list *List) error {
if list.NamespaceID < 0 {
return &ErrListCannotBelongToAPseudoNamespace{ListID: list.ID, NamespaceID: list.NamespaceID}
}
// Check if the namespace exists
if list.NamespaceID > 0 {
_, err := GetNamespaceByID(s, list.NamespaceID)