uc3-dmp-id 0.0.71 → 0.0.73

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 99921e6917f8a405ae38995e797bb69bf05499813ff9b07271ded5657285f94d
4
- data.tar.gz: 17637fbbebb9632878be57ef1b1d53ca6e77cad7dc1505c68bf7626eb47734dd
3
+ metadata.gz: 887398e3e0a37412b53474a625428c286279daec1c7a7c2ef6bd809d7fc7c7e7
4
+ data.tar.gz: ae415d68ee2443712e08c92328dc2770bfeae68135143afb8bea946d7204939d
5
5
  SHA512:
6
- metadata.gz: 9c0b78403c2fcd65a18fce747a91fe3222d1adb895a94f0f2dde1c7957eed7c024a0b3b0ca9170c57a594aded1a1fa56fab1ea43b9f470da7407768bfac0b0e6
7
- data.tar.gz: a7f28875760efb596897e48a17bfe16abef184282fa279bf03e885dfee2bd159fd4bd3c92f95b282d964897189c4ee1b00af5d18ae1e328a2cdcc49cd713ec19
6
+ metadata.gz: ba0cb83cf68f8d4d30200e628790a9c55c78ed094612e025c70de6f547453ef269612d8ef6ac78c29363e5e9052723b46cded49ca6f20ec235f81e99074fe830
7
+ data.tar.gz: 2106286ee96a94ed380c9dea0dcdde7aa629d39bf986efa1cd40c3a8ec6ea150c924ce41c633f8de19b4e6edccc50ffe981112d4495ae35451c6f2dd2932773f
@@ -54,13 +54,14 @@ module Uc3DmpId
54
54
  def _preregister_dmp_id(client:, provenance:, json:, debug: false)
55
55
  # Use the specified DMP ID if the provenance has permission
56
56
  existing = json.fetch('dmp', {}).fetch('dmp_id', {})
57
- id = existing['identifier'].gsub(%r{https?://}, Helper::PK_DMP_PREFIX) if existing.is_a?(Hash) &&
58
- !existing['identifier'].nil?
59
- return id if !id.nil? &&
60
- existing.fetch('type', 'other').to_s.downcase == 'doi' &&
61
- provenance.fetch('seedingWithLiveDmpIds', false).to_s.downcase == 'true' &&
62
- !Finder.exists?(client: client, p_key: id)
57
+ seed_id = json.fetch('dmp', {})['dmproadmap_external_system_identifier']
63
58
 
59
+ # If we are seeding already registered DMP IDs from the Provenance system, then return the original DMP ID
60
+ return seed_id if existing.fetch('type', 'other') == 'url' &&
61
+ !seed_id.nil? &&
62
+ provenance.fetch('seedingWithLiveDmpIds', false).to_s.downcase == 'true'
63
+
64
+ #Generate a new DMP ID
64
65
  dmp_id = ''
65
66
  counter = 0
66
67
  while dmp_id == '' && counter <= 10
@@ -46,8 +46,6 @@ module Uc3DmpId
46
46
  # fetch the existing latest version of the DMP ID
47
47
  client = Uc3DmpDynamo::Client.new(debug: debug)
48
48
  dmp = Finder.by_pk(p_key: p_key, client: client, debug: debug)
49
- # Don't continue if DMP ID could not be found or the contact has no identifier (should be impossible)
50
- raise UpdaterError, MSG_DMP_NOT_FOUND if dmp.nil? || owner_org.nil?
51
49
 
52
50
  errs = _updateable?(provenance: provenance, p_key: p_key, json: dmp['dmp'])
53
51
  raise UpdaterError, errs if errs.is_a?(Array) && errs.any?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Uc3DmpId
4
- VERSION = '0.0.71'
4
+ VERSION = '0.0.73'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uc3-dmp-id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.71
4
+ version: 0.0.73
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Riley
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-29 00:00:00.000000000 Z
11
+ date: 2023-07-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json