uc3-dmp-id 0.1.55 → 0.1.56
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/finder.rb +6 -3
- 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: 1081d13ad36b5435984d6fbb610511f4e99a7f6fb677d4c7aa4bd502776f1166
|
4
|
+
data.tar.gz: 86e564c45241e14a6bcf23e7fb5015b4adf2e2c4ae8a939a0d9c38f22ae58a51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8ae4658ca506e73ae049c901ad1bbdb23817369be5571514bc8cc3bc75c7947d9a62863e565b9bc2085e36f016ba93469d2c5c502bfa65ee70c38625aca159a
|
7
|
+
data.tar.gz: 25e3cfff2baea5a4f20ddf23a6dcd075f959300fa4b973887f6a99c60b77aefd798b522766b99a13d598ac19a1b626d377ee463906a82752a7f2a2cfd8d9330d
|
data/lib/uc3-dmp-id/finder.rb
CHANGED
@@ -135,9 +135,9 @@ module Uc3DmpId
|
|
135
135
|
def _by_owner(owner:, client: nil, logger: nil)
|
136
136
|
orcid_regex = /^([0-9A-Z]{4}-){3}[0-9A-Z]{4}$/
|
137
137
|
email_regex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/
|
138
|
-
email = owner.trim
|
138
|
+
email = owner.trim unless (owner.to_s.trim.gsub('%40', '@') =~ email_regex).nil?
|
139
139
|
|
140
|
-
if
|
140
|
+
if !(owner.to_s.trim =~ orcid_regex).nil?
|
141
141
|
args = {
|
142
142
|
filter_expression: 'contains(:people_ids, people) AND :sk = sk',
|
143
143
|
expression_attribute_values: {
|
@@ -148,11 +148,14 @@ module Uc3DmpId
|
|
148
148
|
]
|
149
149
|
}
|
150
150
|
}
|
151
|
-
|
151
|
+
elsif !email.nil?
|
152
152
|
args = {
|
153
153
|
filter_expression: 'contains(:people, people) AND :sk = sk',
|
154
154
|
expression_attribute_values: { ':sk': 'METADATA', ':people': [email] }
|
155
155
|
}
|
156
|
+
else
|
157
|
+
# It wasn't an email or ORCID, so return an empty array
|
158
|
+
return []
|
156
159
|
end
|
157
160
|
logger&.debug(message: 'Fetch relevant DMPs _by_owner - scan args', details: args)
|
158
161
|
client = Uc3DmpDynamo::Client.new if client.nil?
|
data/lib/uc3-dmp-id/version.rb
CHANGED