when importing boards, don't add user to board if system user (#4173)

This commit is contained in:
Doug Lauder 2022-11-08 13:54:21 -05:00 committed by GitHub
parent 7441d01593
commit bcbc9b8b72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -225,7 +225,8 @@ func (a *App) ImportBoardJSONL(r io.Reader, opt model.ImportArchiveOptions) (str
return "", fmt.Errorf("error inserting archive blocks: %w", err) return "", fmt.Errorf("error inserting archive blocks: %w", err)
} }
// add user to all the new boards. // add user to all the new boards (if not the fake system user).
if opt.ModifiedBy != model.SystemUserID {
for _, board := range boardsAndBlocks.Boards { for _, board := range boardsAndBlocks.Boards {
boardMember := &model.BoardMember{ boardMember := &model.BoardMember{
BoardID: board.ID, BoardID: board.ID,
@ -236,6 +237,7 @@ func (a *App) ImportBoardJSONL(r io.Reader, opt model.ImportArchiveOptions) (str
return "", fmt.Errorf("cannot add member to board: %w", err) return "", fmt.Errorf("cannot add member to board: %w", err)
} }
} }
}
// find new board id // find new board id
for _, board := range boardsAndBlocks.Boards { for _, board := range boardsAndBlocks.Boards {