From 737939082799ffa4451ee1a5bf1e335f836d9cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Mon, 12 Oct 2020 14:22:42 +0300 Subject: [PATCH] Fix whining about AndOr --- app/controllers/repp/v1/contacts_controller.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/controllers/repp/v1/contacts_controller.rb b/app/controllers/repp/v1/contacts_controller.rb index 900c2140d..e7e5c73cf 100644 --- a/app/controllers/repp/v1/contacts_controller.rb +++ b/app/controllers/repp/v1/contacts_controller.rb @@ -35,7 +35,10 @@ module Repp @contact = Epp::Contact.new(contact_params_with_address, current_user.registrar, epp: false) action = Actions::ContactCreate.new(@contact, @legal_doc, contact_ident_params) - handle_errors(@contact) and return unless action.call + unless action.call + handle_errors(@contact) + return + end render_success(code: opt_addr? ? 1100 : nil, data: { contact: { id: @contact.code } }, message: opt_addr? ? I18n.t('epp.contacts.completed_without_address') : nil) @@ -47,7 +50,10 @@ module Repp params[:legal_document], contact_ident_params(required: false), current_user) - handle_errors(@contact) and return unless action.call + unless action.call + handle_errors(@contact) + return + end render_success(code: opt_addr? ? 1100 : nil, data: { contact: { id: @contact.code } }, message: opt_addr? ? I18n.t('epp.contacts.completed_without_address') : nil)