Don't fail when removing the last bucket in migration from other services

This commit is contained in:
kolaente 2021-07-06 15:43:38 +02:00
parent f1df45b632
commit d7932d2648
No known key found for this signature in database
GPG key ID: F40E70337AB24C9B

View file

@ -227,7 +227,7 @@ func InsertFromStructure(str []*models.NamespaceWithLists, user *user.User) (err
}
buckets := bucketsIn.([]*models.Bucket)
err = buckets[0].Delete(s, user)
if err != nil {
if err != nil && !models.IsErrCannotRemoveLastBucket(err) {
_ = s.Rollback()
return err
}