Merge pull request #15 from internetee/staging

Staging
This commit is contained in:
Timo Võhmar 2015-12-01 01:18:49 +02:00
commit 779a57d8b7
4 changed files with 11 additions and 6 deletions

View file

@ -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'

View file

@ -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

View file

@ -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

View file

@ -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