qa: Permit empty content if all is Ok

This commit is contained in:
nemunaire 2020-09-09 19:26:47 +02:00
parent 940b32debc
commit 5aa21d2679

View File

@ -67,7 +67,11 @@ func createExerciceQA(u QAUser, exercice fic.Exercice, body []byte) (interface{}
}
if len(uq.Subject) == 0 {
return nil, errors.New("Subject not filled")
if uq.State == "ok" {
uq.Subject = "RAS"
} else {
return nil, errors.New("Subject not filled")
}
}
if qa, err := exercice.NewQAQuery(uq.Subject, u.TeamId, u.User, uq.State); err != nil {