mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 17:28:18 +02:00
added endpoints to demo registry for accr results
This commit is contained in:
parent
487cbb1774
commit
c07abaea59
20 changed files with 401 additions and 78 deletions
|
@ -56,6 +56,16 @@ class ApiUser < User
|
|||
username
|
||||
end
|
||||
|
||||
def accredited?
|
||||
!accreditation_date.nil?
|
||||
end
|
||||
|
||||
def accreditation_expired?
|
||||
return false if accreditation_expire_date.nil?
|
||||
|
||||
accreditation_expire_date < Time.zone.now
|
||||
end
|
||||
|
||||
def unread_notifications
|
||||
registrar.notifications.unread
|
||||
end
|
||||
|
|
|
@ -190,6 +190,16 @@ class Registrar < ApplicationRecord # rubocop:disable Metrics/ClassLength
|
|||
white_ips.api.include_ip?(ip)
|
||||
end
|
||||
|
||||
def accredited?
|
||||
api_users.any? do |a|
|
||||
return true unless a.accreditation_date.nil?
|
||||
end
|
||||
end
|
||||
|
||||
def accreditation_expired?
|
||||
api_users.all? { |api| api.accreditation_expired? }
|
||||
end
|
||||
|
||||
# Audit log is needed, therefore no raw SQL
|
||||
def replace_nameservers(hostname, new_attributes, domains: [])
|
||||
transaction do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue