diff --git a/libfic/exercice_tag.go b/libfic/exercice_tag.go index 22c4088b..860dd1d4 100644 --- a/libfic/exercice_tag.go +++ b/libfic/exercice_tag.go @@ -1,5 +1,9 @@ package fic +import ( + "strings" +) + // GetTags returns tags associated with this exercice. func (e Exercice) GetTags() (tags []string, err error) { if rows, errr := DBQuery("SELECT tag FROM exercice_tags WHERE id_exercice = ?", e.Id); errr != nil { @@ -22,6 +26,7 @@ func (e Exercice) GetTags() (tags []string, err error) { // AddTag assign a new tag to the exercice and registers it into the database. func (e Exercice) AddTag(tag string) (string, error) { + tag = strings.Title(tag) if _, err := DBExec("INSERT INTO exercice_tags (id_exercice, tag) VALUES (?, ?)", e.Id, tag); err != nil { return "", err } else {