uc3-dmp-id 0.0.79 → 0.0.81
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/uc3-dmp-id/updater.rb +2 -1
- data/lib/uc3-dmp-id/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a5cfc6c3d13bb4d5245abcef1ad55a340f866ae63a11374bff55ec1ea976fa0a
|
4
|
+
data.tar.gz: fc1084accea4f2a55677a83657e28bd5733b8fee518e90f44fa040738fb48a46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e522c602ba745a0f06e5e7c858758c13053b8bdd79564f7dc2ba0223a92ed383db887fb95ba76426d9f058109109cbf4ce053cbc466423e8c67b3f4288cf079a
|
7
|
+
data.tar.gz: b6246a0c62f810d5a629d2e60bc32aae767881e6dc5284aaf0351c2a419c83366fe2f8e49f79b337ccd402c2cc73d7390e7cb6b5e04c46229bc57d321a922910
|
data/lib/uc3-dmp-id/updater.rb
CHANGED
@@ -13,6 +13,7 @@ module Uc3DmpId
|
|
13
13
|
raise UpdaterError, MSG_DMP_INVALID_DMP_ID unless p_key.is_a?(String) && !p_key.strip.empty?
|
14
14
|
|
15
15
|
dmp = Helper.parse_json(json: json)
|
16
|
+
dmp = dmp['dmp'].nil? ? dmp : dmp['dmp']
|
16
17
|
p_key = Helper.append_pk_prefix(p_key: p_key)
|
17
18
|
errs = _updateable?(provenance: provenance, p_key: p_key, json: dmp)
|
18
19
|
|
@@ -84,7 +85,7 @@ puts new_version
|
|
84
85
|
errs = Validator.validate(mode: 'author', json: json)
|
85
86
|
return errs.join(', ') if errs.is_a?(Array) && errs.any? && errs.first != Validator::MSG_VALID_JSON
|
86
87
|
|
87
|
-
puts "Provenance: #{provenance['PK']}, DMP_ID to PK #{Helper.dmp_id_to_pk(json: dmp_id)} == P_KEY: #{p_key}"
|
88
|
+
puts "Provenance: #{provenance['PK']}, DMP_ID to PK #{Helper.dmp_id_to_pk(json: json.fetch('dmp_id', {}))} == P_KEY: #{p_key}"
|
88
89
|
|
89
90
|
# Fail if the provenance is not defined
|
90
91
|
return [MSG_DMP_FORBIDDEN] unless provenance.is_a?(Hash) && !provenance['PK'].nil?
|
data/lib/uc3-dmp-id/version.rb
CHANGED