Adding cmd line options
Этот коммит содержится в:
@@ -35,6 +35,10 @@ func (s SqlTeamStore) CreateIndexesIfNotExists() {
|
||||
}
|
||||
|
||||
func (s SqlTeamStore) Save(team *model.Team) StoreChannel {
|
||||
return s.SaveWithValidate(team, true)
|
||||
}
|
||||
|
||||
func (s SqlTeamStore) SaveWithValidate(team *model.Team, validate bool) StoreChannel {
|
||||
storeChannel := make(StoreChannel)
|
||||
|
||||
go func() {
|
||||
@@ -49,10 +53,13 @@ func (s SqlTeamStore) Save(team *model.Team) StoreChannel {
|
||||
}
|
||||
|
||||
team.PreSave()
|
||||
if result.Err = team.IsValid(); result.Err != nil {
|
||||
storeChannel <- result
|
||||
close(storeChannel)
|
||||
return
|
||||
|
||||
if validate {
|
||||
if result.Err = team.IsValid(); result.Err != nil {
|
||||
storeChannel <- result
|
||||
close(storeChannel)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if err := s.GetMaster().Insert(team); err != nil {
|
||||
|
||||
@@ -39,6 +39,7 @@ type Store interface {
|
||||
|
||||
type TeamStore interface {
|
||||
Save(team *model.Team) StoreChannel
|
||||
SaveWithValidate(team *model.Team, validate bool) StoreChannel
|
||||
Update(team *model.Team) StoreChannel
|
||||
UpdateDisplayName(name string, teamId string) StoreChannel
|
||||
Get(id string) StoreChannel
|
||||
|
||||
Ссылка в новой задаче
Block a user