teams: only write error message if error

This commit is contained in:
Hugo Häggmark
2019-03-08 11:56:48 +01:00
committed by Leonard Gram
parent eea2dcc605
commit 074ebf0f48

View File

@@ -24,8 +24,10 @@ func (hs *HTTPServer) CreateTeam(c *m.ReqContext, cmd m.CreateTeamCommand) Respo
TeamId: cmd.Result.Id,
Permission: int64(m.PERMISSION_ADMIN),
}
err := bus.Dispatch(&addMemberCmd)
c.Logger.Error("Could not add creator to team.", "error", err)
if err := bus.Dispatch(&addMemberCmd); err != nil {
c.Logger.Error("Could not add creator to team.", "error", err)
}
}
return JSON(200, &util.DynMap{