Append additional measurements to compare

Fixes #21
This commit is contained in:
Matthew Dillon 2015-11-13 13:58:03 -07:00
parent 5e5121fc65
commit d6e92a2347

View file

@ -59,11 +59,15 @@ func HandleCompare(w http.ResponseWriter, r *http.Request) *types.AppError {
if (m.CharacteristicID == characteristicIDInt) && (m.StrainID == strainIDInt) {
if m.Notes.Valid {
values[strainID] = fmt.Sprintf("%s (%s)", m.Value(), m.Notes.String)
} else {
if values[strainID] != "" {
values[strainID] = fmt.Sprintf("%s, %s", values[strainID], m.Value())
} else {
values[strainID] = m.Value()
}
}
}
}
// If the strain doesn't have a measurement for this characteristic,
// stick an empty value in anyway (for CSV).
if _, ok := values[strainID]; !ok {