mirror of
https://github.com/Slug-Boi/cocommit.git
synced 2026-05-13 12:45:47 +00:00
fix(json): change groups default from empty string to empty string slice
This commit is contained in:
@@ -250,6 +250,15 @@ func (m *model_ca) AddAuthor() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
|
var groups []string
|
||||||
|
if m.inputs[4].Value() == "" {
|
||||||
|
groups = []string{}
|
||||||
|
} else {
|
||||||
|
groups = strings.Split(m.inputs[4].Value(), "|")
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// create and add the user to the users map
|
// create and add the user to the users map
|
||||||
usr := utils.User{
|
usr := utils.User{
|
||||||
@@ -258,7 +267,7 @@ func (m *model_ca) AddAuthor() {
|
|||||||
Username: m.inputs[2].Value(),
|
Username: m.inputs[2].Value(),
|
||||||
Email: m.inputs[3].Value(),
|
Email: m.inputs[3].Value(),
|
||||||
Ex: m.exclude,
|
Ex: m.exclude,
|
||||||
Groups: strings.Split(m.inputs[4].Value(), "|"),
|
Groups: groups,
|
||||||
}
|
}
|
||||||
|
|
||||||
utils.Users[m.inputs[0].Value()] = usr
|
utils.Users[m.inputs[0].Value()] = usr
|
||||||
|
|||||||
Reference in New Issue
Block a user