Commit 6edee05ff50a48dd7fd4c53e07bd115de9e4ae2e
1 parent
471be0f8
Exists in
master
and in
5 other branches
Fix error messages for registration
Showing
1 changed file
with
7 additions
and
3 deletions
Show diff stats
js/main.js
| @@ -30,7 +30,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F | @@ -30,7 +30,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F | ||
| 30 | window.recaptchaSiteKey = '6LcLPAcTAAAAAKsd0bxY_TArhD_A7OL19SRCW7_i' | 30 | window.recaptchaSiteKey = '6LcLPAcTAAAAAKsd0bxY_TArhD_A7OL19SRCW7_i' |
| 31 | }else{ | 31 | }else{ |
| 32 | var host = 'http://noosfero.com:3000'; | 32 | var host = 'http://noosfero.com:3000'; |
| 33 | - var proposal_discussion = '372'; //local serpro | 33 | + var proposal_discussion = '392'; //local serpro |
| 34 | window.recaptchaSiteKey = '6LdsWAcTAAAAAChTUUD6yu9fCDhdIZzNd7F53zf-' //http://noosfero.com/ | 34 | window.recaptchaSiteKey = '6LdsWAcTAAAAAChTUUD6yu9fCDhdIZzNd7F53zf-' //http://noosfero.com/ |
| 35 | } | 35 | } |
| 36 | 36 | ||
| @@ -759,9 +759,13 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F | @@ -759,9 +759,13 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F | ||
| 759 | data: $(this).parents('.signup').serialize(), | 759 | data: $(this).parents('.signup').serialize(), |
| 760 | }).done(function(data) { | 760 | }).done(function(data) { |
| 761 | Main.loginCallback(true, data.private_token); | 761 | Main.loginCallback(true, data.private_token); |
| 762 | - }).fail(function( /*data*/ ) { | 762 | + }).fail(function(data) { |
| 763 | + var msg = ""; | ||
| 764 | + var o = JSON.parse(data.responseJSON.message); | ||
| 765 | + Object.keys(o).map(function(k) { msg += k + " " + o[k] + ", " }); | ||
| 766 | + msg = msg.substring(0, msg.length - 2) + "."; | ||
| 763 | message.show(); | 767 | message.show(); |
| 764 | - message.text('Não foi possível efetuar o cadastro'); | 768 | + message.text('Não foi possível efetuar o cadastro: ' + msg); |
| 765 | }).always(function() { | 769 | }).always(function() { |
| 766 | loading.hide(); | 770 | loading.hide(); |
| 767 | signup.show(); | 771 | signup.show(); |