1
0

Added check for list title when creating a new list

This commit is contained in:
kolaente
2018-07-26 10:29:09 +02:00
parent a9094506fa
commit 935aef8a38
4 changed files with 48 additions and 0 deletions

View File

@ -3,6 +3,11 @@ package models
// CreateOrUpdateList updates a list or creates it if it doesn't exist
func CreateOrUpdateList(list *List) (err error) {
// Check we have at least a title
if list.Title == "" {
return ErrListTitleCannotBeEmpty{}
}
if list.ID == 0 {
_, err = x.Insert(list)
} else {