Skip to content

Commit

Permalink
Fix bug that made signup fail
Browse files Browse the repository at this point in the history
UserRepository.Insert incorrectly checked
for sql.ErrNoRows, when it should have checked
for repositories.NotFoundError.
  • Loading branch information
peterskeide committed Dec 4, 2013
1 parent c0c815c commit ea13dce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion db/sqlrepositories/user_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (r UserRepository) Insert(user *entities.User) error {
_, err := r.FindByEmail(user.Email)

if err != nil {
if err == sql.ErrNoRows {
if err == repositories.NotFoundError {
return r.Exec("INSERT INTO users (email, password) VALUES ($1, $2)", user.Email, user.Password)
}

Expand Down

0 comments on commit ea13dce

Please sign in to comment.