From 8071eb874d65c1584b94e4aaaaaf81a4e0c60a15 Mon Sep 17 00:00:00 2001 From: omggga Date: Wed, 18 Oct 2023 13:40:59 +0300 Subject: [PATCH] prevent ModifiedBy overwrite --- server/app/import.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/app/import.go b/server/app/import.go index 2852c0e3e..d1e47171e 100644 --- a/server/app/import.go +++ b/server/app/import.go @@ -200,7 +200,9 @@ func (a *App) ImportBoardJSONL(r io.Reader, opt model.ImportArchiveOptions) (*mo if err2 := json.Unmarshal(archiveLine.Data, &board); err2 != nil { return nil, fmt.Errorf("invalid board in archive line %d: %w", lineNum, err2) } - board.ModifiedBy = userID + if board.ModifiedBy == "" { + board.ModifiedBy = userID + } board.UpdateAt = now board.TeamID = opt.TeamID boardsAndBlocks.Boards = append(boardsAndBlocks.Boards, &board) @@ -224,7 +226,9 @@ func (a *App) ImportBoardJSONL(r io.Reader, opt model.ImportArchiveOptions) (*mo if err2 := json.Unmarshal(archiveLine.Data, &block); err2 != nil { return nil, fmt.Errorf("invalid block in archive line %d: %w", lineNum, err2) } - block.ModifiedBy = userID + if block.ModifiedBy == "" { + block.ModifiedBy = userID + } block.UpdateAt = now block.BoardID = boardID boardsAndBlocks.Blocks = append(boardsAndBlocks.Blocks, block)