diff --git a/app/controllers/invitations_controller.rb b/app/controllers/invitations_controller.rb index 2bd519c75..b5476a3f0 100644 --- a/app/controllers/invitations_controller.rb +++ b/app/controllers/invitations_controller.rb @@ -45,7 +45,10 @@ class InvitationsController < Devise::InvitationsController user.seed_aspects rescue Exception => e user = nil - flash[:error] = e.message + record = e.record + record.errors.delete(:person) + + flash[:error] = record.errors.full_messages.join(", ") end if user diff --git a/app/controllers/registrations_controller.rb b/app/controllers/registrations_controller.rb index 66036eab5..7385e90b5 100644 --- a/app/controllers/registrations_controller.rb +++ b/app/controllers/registrations_controller.rb @@ -13,7 +13,9 @@ class RegistrationsController < Devise::RegistrationsController sign_in_and_redirect(:user, @user) Rails.logger.info("event=registration status=successful user=#{@user.diaspora_handle}") else - flash[:error] = @user.errors.full_messages.join(', ') + @user.errors.delete(:person) + + flash[:error] = @user.errors.full_messages.join(";") Rails.logger.info("event=registration status=failure errors='#{@user.errors.full_messages.join(', ')}'") render :new end