mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 03:06:14 +02:00
Fix merge conflicts
This commit is contained in:
commit
8a046b59bf
210 changed files with 5560 additions and 1569 deletions
30
app/controllers/admin/bounced_mail_addresses_controller.rb
Normal file
30
app/controllers/admin/bounced_mail_addresses_controller.rb
Normal file
|
@ -0,0 +1,30 @@
|
|||
module Admin
|
||||
class BouncedMailAddressesController < BaseController
|
||||
before_action :set_bounced_mail_address, only: %i[show destroy]
|
||||
load_and_authorize_resource
|
||||
|
||||
# GET /bounced_mail_addresses
|
||||
def index
|
||||
@bounced_mail_addresses = BouncedMailAddress.all.order(created_at: :desc)
|
||||
end
|
||||
|
||||
# GET /bounced_mail_addresses/1
|
||||
def show; end
|
||||
|
||||
# DELETE /bounced_mail_addresses/1
|
||||
def destroy
|
||||
@bounced_mail_address.destroy
|
||||
redirect_to(
|
||||
admin_bounced_mail_addresses_url,
|
||||
notice: 'Bounced mail address was successfully destroyed.'
|
||||
)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_bounced_mail_address
|
||||
@bounced_mail_address = BouncedMailAddress.find(params[:id])
|
||||
end
|
||||
end
|
||||
end
|
|
@ -4,26 +4,15 @@ module Admin
|
|||
def create
|
||||
authorize! :manage, domain
|
||||
|
||||
notice = t('.scheduled')
|
||||
|
||||
domain.transaction do
|
||||
domain.schedule_force_delete(type: force_delete_type)
|
||||
domain.registrar.notifications.create!(text: t('force_delete_set_on_domain',
|
||||
domain_name: domain.name,
|
||||
outzone_date: domain.outzone_date,
|
||||
purge_date: domain.purge_date))
|
||||
|
||||
notify_by_email if notify_by_email?
|
||||
result = domain.schedule_force_delete(type: force_delete_type,
|
||||
notify_by_email: notify_by_email?)
|
||||
notice = result.errors.messages[:domain].first unless result.valid?
|
||||
end
|
||||
|
||||
redirect_to edit_admin_domain_url(domain), notice: t('.scheduled')
|
||||
end
|
||||
|
||||
def notify_by_email
|
||||
if force_delete_type == :fast_track
|
||||
send_email
|
||||
domain.update(contact_notification_sent_date: Time.zone.today)
|
||||
else
|
||||
domain.update(template_name: domain.notification_template)
|
||||
end
|
||||
redirect_to edit_admin_domain_url(domain), notice: notice
|
||||
end
|
||||
|
||||
def destroy
|
||||
|
@ -42,13 +31,6 @@ module Admin
|
|||
ActiveRecord::Type::Boolean.new.cast(params[:notify_by_email])
|
||||
end
|
||||
|
||||
def send_email
|
||||
DomainDeleteMailer.forced(domain: domain,
|
||||
registrar: domain.registrar,
|
||||
registrant: domain.registrant,
|
||||
template_name: domain.notification_template).deliver_now
|
||||
end
|
||||
|
||||
def force_delete_type
|
||||
soft_delete? ? :soft : :fast_track
|
||||
end
|
||||
|
|
|
@ -2,7 +2,6 @@ module Admin
|
|||
class DomainsController < BaseController
|
||||
before_action :set_domain, only: %i[show edit update keep]
|
||||
authorize_resource
|
||||
helper_method :force_delete_templates
|
||||
|
||||
def index
|
||||
params[:q] ||= {}
|
||||
|
@ -105,9 +104,5 @@ module Admin
|
|||
|
||||
params[:q][:valid_to_lteq] = ca_cache
|
||||
end
|
||||
|
||||
def force_delete_templates
|
||||
DomainDeleteMailer.force_delete_templates
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue