Don't add templates to default category (#4174)

* don't add templates to default category

* check for IsTemplate rather than teamID = 0, as Personal Server is always teamid = 0
This commit is contained in:
Scott Bishel 2022-11-08 12:12:56 -07:00 committed by GitHub
parent bcbc9b8b72
commit 1454095bdd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -300,7 +300,7 @@ func (a *App) CreateBoard(board *model.Board, userID string, addMember bool) (*m
return nil
})
if board.TeamID != "0" {
if !board.IsTemplate {
if err := a.addBoardsToDefaultCategory(userID, newBoard.TeamID, []*model.Board{newBoard}); err != nil {
return nil, err
}
@ -519,8 +519,10 @@ func (a *App) AddMemberToBoard(member *model.BoardMember) (*model.BoardMember, e
return nil, err
}
if err = a.addBoardsToDefaultCategory(member.UserID, board.TeamID, []*model.Board{board}); err != nil {
return nil, err
if !board.IsTemplate {
if err = a.addBoardsToDefaultCategory(member.UserID, board.TeamID, []*model.Board{board}); err != nil {
return nil, err
}
}
a.blockChangeNotifier.Enqueue(func() error {