Mercurial > hg > soundsoftware-site
changeset 1541:2696466256ff live
Fix erroneous error message when no hits found
author | Chris Cannam |
---|---|
date | Tue, 02 Jun 2015 12:24:46 +0100 |
parents | 322d7b57e5f0 |
children | 60acfbd8f6d6 |
files | app/models/repository.rb |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/app/models/repository.rb Tue Jun 02 10:58:31 2015 +0100 +++ b/app/models/repository.rb Tue Jun 02 12:24:46 2015 +0100 @@ -326,7 +326,9 @@ if username.strip =~ /^([^ ]+) ([^ ]+)$/ first, last = $1, $2 uu = User.where(:firstname => first, :lastname => last) - if uu.length == 1 + if uu.empty? + logger.warn "find_committer_user: found no user with name matching #{username}, ignoring" + elsif uu.length == 1 u = uu.first else logger.warn "find_committer_user: found more than one (#{uu.length}) results for user named #{username}, ignoring"