allow duplicating cards/baords if filecopy fails (#3012)
* allow duplicating cards/baords if filecopy fails * change back to error logs
This commit is contained in:
parent
1ff28087f8
commit
31a3ba8e6a
2 changed files with 1 additions and 7 deletions
|
@ -239,8 +239,6 @@ func (a *App) CopyCardFiles(sourceBoardID string, copiedBlocks []model.Block) er
|
|||
mlog.String("destinationFilePath", destinationFilePath),
|
||||
mlog.Err(err),
|
||||
)
|
||||
|
||||
return err
|
||||
}
|
||||
block.Fields["fileId"] = destFilename
|
||||
}
|
||||
|
|
|
@ -150,11 +150,7 @@ func (a *App) DuplicateBoard(boardID, userID, toTeam string, asTemplate bool) (*
|
|||
|
||||
// copy any file attachments from the duplicated blocks.
|
||||
if err = a.CopyCardFiles(boardID, bab.Blocks); err != nil {
|
||||
dbab := model.NewDeleteBoardsAndBlocksFromBabs(bab)
|
||||
if err = a.store.DeleteBoardsAndBlocks(dbab, userID); err != nil {
|
||||
a.logger.Error("Cannot delete board after duplication error when copying block's files", mlog.String("boardID", bab.Boards[0].ID), mlog.Err(err))
|
||||
}
|
||||
return nil, nil, fmt.Errorf("could not copy files while duplicating board %s: %w", boardID, err)
|
||||
a.logger.Error("Could not copy files while duplicating board", mlog.String("BoardID", boardID), mlog.Err(err))
|
||||
}
|
||||
|
||||
// bab.Blocks now has updated file ids for any blocks containing files. We need to store them.
|
||||
|
|
Loading…
Reference in a new issue