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) {
users = append(
users,
user{
Info: u,
admin: true,
},
)
_, err := getUser(u.Email)
if err != nil {
users = append(
users,
user{
Info: u,
admin: true,
},
)
}
}