From 2d8eb8f02cec6dde33e78631ffa0929664f6ca2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Erik=20=C3=95unapuu?= Date: Tue, 3 Nov 2020 14:43:46 +0200 Subject: [PATCH] Make ForceDelete CSV fields snake case --- app/models/mass_action.rb | 4 ++-- app/views/admin/mass_actions/index.html.erb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/mass_action.rb b/app/models/mass_action.rb index fc389be80..73c0d024d 100644 --- a/app/models/mass_action.rb +++ b/app/models/mass_action.rb @@ -9,8 +9,8 @@ class MassAction log = { ok: [], fail: [] } entries = CSV.read(entries, headers: true) entries.each do |e| - dn = Domain.find_by(name_puny: e['Domain name']) - log[:fail] << e['Domain name'] and next unless dn + dn = Domain.find_by(name_puny: e['domain_name']) + log[:fail] << e['domain_name'] and next unless dn dn.schedule_force_delete(type: :soft, notify: true) log[:ok] << dn.name diff --git a/app/views/admin/mass_actions/index.html.erb b/app/views/admin/mass_actions/index.html.erb index 192168f42..54c108ccb 100644 --- a/app/views/admin/mass_actions/index.html.erb +++ b/app/views/admin/mass_actions/index.html.erb @@ -5,7 +5,7 @@
Bulk Domain Force Delete
-

Triggers soft force delete procedure for uploaded domain list. List must be in CSV format. Each domain entry must be on separate line. Line must include domain name with delete reason, separated by comma.

+

Triggers soft force delete procedure for uploaded domain list. List must be in CSV format. Each domain entry must be on separate line. Line must include domain_name (puny) followed with delete_reason, separated by comma.

Allowed delete reasons: IDENT_BURIED | PHONE | EMAIL

<%= form_tag admin_mass_actions_path, multipart: true do %> <%= file_field_tag :entry_list, accept: 'text/csv' %>