don't allow duplicate users to be added

This commit is contained in:
Derek McQuay 2016-08-22 21:08:06 -07:00
parent 36a90e04c8
commit d2349d2105

17
user.go
View File

@ -47,11 +47,14 @@ func getUser(e string) (int, error) {
} }
func addUser(u userInfo) { func addUser(u userInfo) {
users = append( _, err := getUser(u.Email)
users, if err != nil {
user{ users = append(
Info: u, users,
admin: true, user{
}, Info: u,
) admin: true,
},
)
}
} }