mirror of
https://github.com/mattermost/focalboard.git
synced 2024-11-27 08:31:20 +02:00
when importing boards, don't add user to board if system user (#4173)
This commit is contained in:
parent
7441d01593
commit
bcbc9b8b72
@ -225,15 +225,17 @@ func (a *App) ImportBoardJSONL(r io.Reader, opt model.ImportArchiveOptions) (str
|
||||
return "", fmt.Errorf("error inserting archive blocks: %w", err)
|
||||
}
|
||||
|
||||
// add user to all the new boards.
|
||||
for _, board := range boardsAndBlocks.Boards {
|
||||
boardMember := &model.BoardMember{
|
||||
BoardID: board.ID,
|
||||
UserID: opt.ModifiedBy,
|
||||
SchemeAdmin: true,
|
||||
}
|
||||
if _, err := a.AddMemberToBoard(boardMember); err != nil {
|
||||
return "", fmt.Errorf("cannot add member to board: %w", err)
|
||||
// add user to all the new boards (if not the fake system user).
|
||||
if opt.ModifiedBy != model.SystemUserID {
|
||||
for _, board := range boardsAndBlocks.Boards {
|
||||
boardMember := &model.BoardMember{
|
||||
BoardID: board.ID,
|
||||
UserID: opt.ModifiedBy,
|
||||
SchemeAdmin: true,
|
||||
}
|
||||
if _, err := a.AddMemberToBoard(boardMember); err != nil {
|
||||
return "", fmt.Errorf("cannot add member to board: %w", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user