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
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 1 additions and 1 deletions

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
}