From 0b067cf1d343080e98a84739ed2cee8526432309 Mon Sep 17 00:00:00 2001 From: Arthur Del Esposte Date: Fri, 26 Jun 2015 21:49:25 +0000 Subject: [PATCH] Handle ActiveRecord::RecordInvalid exceptions in remote user plugin --- plugins/remote_user/lib/remote_user_plugin.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/remote_user/lib/remote_user_plugin.rb b/plugins/remote_user/lib/remote_user_plugin.rb index 7160e1d..5e013df 100644 --- a/plugins/remote_user/lib/remote_user_plugin.rb +++ b/plugins/remote_user/lib/remote_user_plugin.rb @@ -48,8 +48,11 @@ class RemoteUserPlugin < Noosfero::Plugin end end end + rescue ::ActiveRecord::RecordInvalid + session[:notice] = _('Could not create the remote user.') + render_404 rescue - session[:notice] = _('Could not create the remote_user.') + session[:notice] = _("Could not log in.") render_404 end end -- libgit2 0.21.2