From 7ce525ddef203424edaa056754a14494b4e9162d Mon Sep 17 00:00:00 2001 From: Vladimir Krylov Date: Tue, 1 Dec 2015 00:38:07 +0200 Subject: [PATCH 1/3] fix admin user destroy redirection --- app/controllers/admin/admin_users_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/admin/admin_users_controller.rb b/app/controllers/admin/admin_users_controller.rb index 17de2f97d..86ff97510 100644 --- a/app/controllers/admin/admin_users_controller.rb +++ b/app/controllers/admin/admin_users_controller.rb @@ -43,7 +43,7 @@ class Admin::AdminUsersController < AdminController def destroy if @admin_user.destroy flash[:notice] = I18n.t('record_deleted') - redirect_to admin_users_path + redirect_to admin_admin_users_path else flash.now[:alert] = I18n.t('failed_to_delete_record') render 'show' From 5d1f691967dc76de2a5d5fe54c1d3a42e705da94 Mon Sep 17 00:00:00 2001 From: Vladimir Krylov Date: Tue, 1 Dec 2015 01:08:04 +0200 Subject: [PATCH 2/3] white IPs in admin generate ip link only if they exists --- app/views/admin/registrars/show.haml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/admin/registrars/show.haml b/app/views/admin/registrars/show.haml index c44523d87..728386f36 100644 --- a/app/views/admin/registrars/show.haml +++ b/app/views/admin/registrars/show.haml @@ -96,6 +96,10 @@ %tbody - @registrar.white_ips.each do |x| %tr - %td= link_to(x.ipv4, [:admin, @registrar, x]) - %td= link_to(x.ipv6, [:admin, @registrar, x]) + %td + - if x.ipv4.present? + = link_to(x.ipv4, [:admin, @registrar, x]) + %td + - x.ipv6.present? + = link_to(x.ipv6, [:admin, @registrar, x]) %td= x.interfaces.join(', ').upcase From fa7cf13bf4faa50a487ce5a10bfffecfba223907 Mon Sep 17 00:00:00 2001 From: Vladimir Krylov Date: Tue, 1 Dec 2015 01:17:28 +0200 Subject: [PATCH 3/3] Invoice forward saves email --- app/mailers/invoice_mailer.rb | 5 +++-- app/models/invoice.rb | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/mailers/invoice_mailer.rb b/app/mailers/invoice_mailer.rb index 54c6a8605..c3eb20f6f 100644 --- a/app/mailers/invoice_mailer.rb +++ b/app/mailers/invoice_mailer.rb @@ -1,8 +1,9 @@ class InvoiceMailer < ApplicationMailer include Que::Mailer - def invoice_email(invoice_id, html) + def invoice_email(invoice_id, html, billing_email) @invoice = Invoice.find_by(id: invoice_id) + billing_email ||= @invoice.billing_email return unless @invoice return if whitelist_blocked?(@invoice.billing_email) @@ -11,6 +12,6 @@ class InvoiceMailer < ApplicationMailer invoice = @invoice attachments[invoice.pdf_name] = pdf - mail(to: format(invoice.billing_email), subject: invoice) + mail(to: format(billing_email), subject: invoice) end end diff --git a/app/models/invoice.rb b/app/models/invoice.rb index 0c4e23a08..8bc5137d5 100644 --- a/app/models/invoice.rb +++ b/app/models/invoice.rb @@ -117,7 +117,7 @@ class Invoice < ActiveRecord::Base return false unless valid? return false unless billing_email.present? - InvoiceMailer.invoice_email(id, html).deliver + InvoiceMailer.invoice_email(id, html, billing_email).deliver true end