Merge branch 'staging' of https://github.com/internetee/registry into staging

This commit is contained in:
Georg Kahest 2015-12-03 18:52:58 +02:00
commit 51394c795e
5 changed files with 18 additions and 16 deletions

View file

@ -67,8 +67,7 @@ class ApplicationController < ActionController::Base
end end
def user_log_str(user) def user_log_str(user)
return 'public' if user.nil? user.nil? ? 'public' : user.string
"#{user.id}-#{user.class}: #{user.username}"
end end
def comma_support_for(parent_key, key) def comma_support_for(parent_key, key)

View file

@ -504,6 +504,7 @@ class Epp::Domain < Domain
old_registrant_email = DomainMailer.registrant_updated_notification_for_old_registrant(id, deliver_emails) old_registrant_email = DomainMailer.registrant_updated_notification_for_old_registrant(id, deliver_emails)
preclean_pendings preclean_pendings
user = ApiUser.find(pending_json['current_user_id']) user = ApiUser.find(pending_json['current_user_id'])
::PaperTrail.whodunnit = user.string # updator str should be the request originator not the approval user
frame = Nokogiri::XML(pending_json['frame']) frame = Nokogiri::XML(pending_json['frame'])
statuses.delete(DomainStatus::PENDING_UPDATE) statuses.delete(DomainStatus::PENDING_UPDATE)
yield(self) if block_given? # need to skip statuses check here yield(self) if block_given? # need to skip statuses check here

View file

@ -3,4 +3,9 @@ class User < ActiveRecord::Base
devise :trackable, :timeoutable devise :trackable, :timeoutable
attr_accessor :phone attr_accessor :phone
def string
"#{self.id}-#{self.class}: #{self.username}"
end
end end

View file

@ -46,15 +46,13 @@ xml.epp_head do
xml.tag!('contact:email', 'No access') xml.tag!('contact:email', 'No access')
end end
xml.tag!('contact:clID', @contact.registrar.try(:name)) xml.tag!('contact:clID', @contact.registrar.try(:code))
if @contact.creator.try(:registrar).blank? && Rails.env.test?
xml.tag!('contact:crID', 'TEST-CREATOR') xml.tag!('contact:crID', @contact.creator.registrar.try(:code))
else
xml.tag!('contact:crID', @contact.creator.try(:registrar))
end
xml.tag!('contact:crDate', @contact.created_at.try(:iso8601)) xml.tag!('contact:crDate', @contact.created_at.try(:iso8601))
if @contact.updated_at != @contact.created_at if @contact.updated_at != @contact.created_at
xml.tag!('contact:upID', @contact.updator.try(:registrar)) xml.tag!('contact:upID', @contact.updator.registrar.code) if @contact.updator.try(:registrar).present?
xml.tag!('contact:upDate', @contact.updated_at.try(:iso8601)) xml.tag!('contact:upDate', @contact.updated_at.try(:iso8601))
end end
# xml.tag!('contact:trDate', '123') if false # xml.tag!('contact:trDate', '123') if false

View file

@ -36,19 +36,18 @@ xml.epp_head do
## TODO Find out what this domain:host is all about ## TODO Find out what this domain:host is all about
xml.tag!('domain:clID', @domain.registrar_name) xml.tag!('domain:clID', @domain.registrar.code)
xml.tag!('domain:crID', @domain.creator.try(:registrar) || @domain.creator) if @domain.creator
xml.tag!('domain:crID', @domain.creator.registrar.code) if @domain.creator
xml.tag!('domain:crDate', @domain.created_at.try(:iso8601)) xml.tag!('domain:crDate', @domain.created_at.try(:iso8601))
xml.tag!('domain:upDate', @domain.updated_at.try(:iso8601)) if @domain.updated_at != @domain.created_at if @domain.updated_at != @domain.created_at
xml.tag!('domain:upID', @domain.updator.registrar.code) if @domain.updator.try(:registrar).present?
xml.tag!('domain:upDate', @domain.updated_at.try(:iso8601))
end
xml.tag!('domain:exDate', @domain.valid_to.try(:iso8601)) xml.tag!('domain:exDate', @domain.valid_to.try(:iso8601))
# TODO Make domain stampable
#xml.tag!('domain:upID', @domain.updated_by)
# TODO Make domain transferrable # TODO Make domain transferrable
#xml.tag!('domain:trDate', @domain.transferred_at) if @domain.transferred_at #xml.tag!('domain:trDate', @domain.transferred_at) if @domain.transferred_at