Added check if the namespace exists when creating a list

This commit is contained in:
kolaente 2018-07-26 10:49:33 +02:00
parent 6eeab7fe10
commit c97a4d74cb
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -8,6 +8,12 @@ func CreateOrUpdateList(list *List) (err error) {
return ErrListTitleCannotBeEmpty{}
}
// Check if the namespace exists
_, err = GetNamespaceByID(list.NamespaceID)
if err != nil {
return err
}
if list.ID == 0 {
_, err = x.Insert(list)
} else {