diff --git a/app/services/imports/scheme_import_service.rb b/app/services/imports/scheme_import_service.rb index e7440d393..56f19294d 100644 --- a/app/services/imports/scheme_import_service.rb +++ b/app/services/imports/scheme_import_service.rb @@ -49,12 +49,6 @@ module Imports attributes["arrangement_type"] = string_or_nil(xml_doc, "arrangement_type") attributes["owning_org_old_id"] = string_or_nil(xml_doc, "institution") attributes["owning_organisation_id"] = find_owning_organisation_id(attributes["owning_org_old_id"]) - attributes["management_org_old_visible_id"] = safe_string_as_integer(xml_doc, "agent") - attributes["managing_organisation_id"] = find_managing_organisation_id(attributes["management_org_old_visible_id"]) - - if attributes["arrangement_type"] == "D" && attributes["managing_organisation_id"].nil? - attributes["managing_organisation_id"] = attributes["owning_organisation_id"] - end attributes end @@ -65,14 +59,5 @@ module Imports organisation.id end - - def find_managing_organisation_id(old_visible_id) - return unless old_visible_id - - organisation = Organisation.find_by(old_visible_id:) - raise "Organisation not found with legacy visible ID #{old_visible_id}" if organisation.nil? - - organisation.id - end end end