Merge remote-tracking branch 'origin/master' into repp-domains

This commit is contained in:
Karl Erik Õunapuu 2021-03-22 14:05:42 +02:00
commit e2f377f1c2
No known key found for this signature in database
GPG key ID: C9DD647298A34764
187 changed files with 1934 additions and 2552 deletions

View file

@ -12,9 +12,11 @@ module Epp
@notification = current_user.unread_notifications.order('created_at DESC').take
render_epp_response 'epp/poll/poll_no_messages' and return unless @notification
if @notification.attached_obj_type && @notification.attached_obj_id
begin
@object = Object.const_get(@notification.attached_obj_type).find(@notification.attached_obj_id)
@object = object_by_type(@notification.attached_obj_type)
.find(@notification.attached_obj_id)
rescue => problem
# the data model might be inconsistent; or ...
# this could happen if the registrar does not dequeue messages, and then the domain was deleted
@ -31,6 +33,12 @@ module Epp
render_epp_response 'epp/poll/poll_req'
end
def object_by_type(object_type)
Object.const_get(object_type)
rescue NameError
Object.const_get("Version::#{object_type}")
end
def ack_poll
@notification = current_user.unread_notifications.find_by(id: params[:parsed_frame].css('poll').first['msgID'])