Commit 1a854cf9062fad11a231e1730cca95913a4cb1da

Authored by Antonio Terceiro
2 parents 2cd9e2e5 0b067cf1

Merge branch 'remote_user_fix' into 'master'

Handle ActiveRecord::RecordInvalid exceptions in remote user plugin

Fix #612

See merge request !616
Showing 1 changed file with 4 additions and 1 deletions   Show diff stats
plugins/remote_user/lib/remote_user_plugin.rb
@@ -48,8 +48,11 @@ class RemoteUserPlugin < Noosfero::Plugin @@ -48,8 +48,11 @@ class RemoteUserPlugin < Noosfero::Plugin
48 end 48 end
49 end 49 end
50 end 50 end
  51 + rescue ::ActiveRecord::RecordInvalid
  52 + session[:notice] = _('Could not create the remote user.')
  53 + render_404
51 rescue 54 rescue
52 - session[:notice] = _('Could not create the remote_user.') 55 + session[:notice] = _("Could not log in.")
53 render_404 56 render_404
54 end 57 end
55 end 58 end