Skip to content

Commit

Permalink
Fix locale attribute name for csync
Browse files Browse the repository at this point in the history
  • Loading branch information
karlerikounapuu committed Jun 10, 2020
1 parent 1e3d0c4 commit 3e8eeb4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions app/models/csync_record.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,7 @@ def record_new_scan(result)
def compose_record_meta(result)
result[:last_scan] = Time.zone.now
result[:times_scanned] = persisted? && cdnskey != result[:cdnskey] ? 1 : times_scanned + 1
result[:action] = if result[:type] == :secure
'rollover'
elsif result[:type] == :insecure
'initialize'
elsif result[:cdnskey] == '0 3 0 0'
'deactivate'
end
result[:action] = determine_csync_intention(result[:type], result[:cdnskey])
result.except(:type, :ns, :ns_ip)
end

Expand Down Expand Up @@ -72,7 +66,7 @@ def notify_registrar_about_csync
registrar = domain.registrar
registrar.notifications.create!(
text: I18n.t('notifications.texts.csync',
domain_name: domain.name,
domain: domain.name,
action: action)
)
end
Expand All @@ -93,4 +87,10 @@ def self.clear(domain_name)
domains = Domain.where(name: domain_name).all
CsyncRecord.where(domain: domains).delete_all
end

def determine_csync_intention(type, cdnskey)
return 'rollover' if type == 'secure' && cdnskey != '0 3 0 0'
return 'initialized' if type == 'insecure'
return 'deactivate' if cdnskey == '0 3 0 0'
end
end
2 changes: 1 addition & 1 deletion config/locales/mailers/csync.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ en:
subject: >-
Teie domeeni %{domain_name} DNSSEC andmed on uuendatud
/ DNSSEC data for %{domain_name} has been updated
dnssec_updated:
dnssec_deleted:
subject: >-
Teie domeeni %{domain_name} DNSSEC andmed on eemaldatud
/ DNSSEC data for %{domain_name} has been removed

0 comments on commit 3e8eeb4

Please sign in to comment.