Commit 9b86fdd12680e0e031b8989b2b529378a0c6c430
1 parent
e2b528dd
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
Api using a message for each error
Showing
1 changed file
with
3 additions
and
2 deletions
Show diff stats
lib/noosfero/api/session.rb
... | ... | @@ -41,8 +41,9 @@ module Noosfero |
41 | 41 | attrs = attributes_for_keys [:email, :login, :password, :password_confirmation] + environment.signup_person_fields |
42 | 42 | remote_ip = (request.respond_to?(:remote_ip) && request.remote_ip) || (env && env['REMOTE_ADDR']) |
43 | 43 | |
44 | - unless test_captcha(remote_ip, params, environment) == true | |
45 | - render_api_error!(_('Please solve the test in order to register.'), 401) | |
44 | + result = test_captcha(remote_ip, params, environment) | |
45 | + unless result == true | |
46 | + render_api_error!(result, 401) | |
46 | 47 | return |
47 | 48 | end |
48 | 49 | ... | ... |