oarepo-runtime 1.5.87__py3-none-any.whl → 1.5.89__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,10 +14,13 @@ class RecordOwners(Generator):
14
14
  return []
15
15
  if current_app.config.get('INVENIO_RDM_ENABLED', False):
16
16
  owners = getattr(record.parent.access, "owned_by", None)
17
+ if owners is not None:
18
+ owners_list = owners if isinstance(owners, list) else [owners]
19
+ return [UserNeed(owner.owner_id) for owner in owners_list]
17
20
  else:
18
21
  owners = getattr(record.parent, "owners", None)
19
- if owners is not None:
20
- return [UserNeed(owner.id) for owner in owners]
22
+ if owners is not None:
23
+ return [UserNeed(owner.id) for owner in owners]
21
24
  return []
22
25
 
23
26
  def query_filter(self, identity=None, **kwargs):
@@ -2,6 +2,7 @@ import functools
2
2
  import re
3
3
  from datetime import datetime
4
4
  from idutils import normalize_pid
5
+ from isbnlib import canonical, mask
5
6
 
6
7
  from marshmallow.exceptions import ValidationError
7
8
  from marshmallow_utils.fields.edtfdatestring import EDTFValidator
@@ -11,6 +12,11 @@ from invenio_i18n import gettext as _
11
12
 
12
13
  def validate_identifier(value):
13
14
  try:
15
+ if value["scheme"].lower() == "isbn":
16
+ canonical_isbn = canonical(value["identifier"])
17
+ value["identifier"] = mask(canonical_isbn)
18
+ return value["identifier"]
19
+
14
20
  original_identifier = (value["identifier"] or '').strip()
15
21
  normalized_identifier = normalize_pid(
16
22
  value["identifier"], value["scheme"].lower()
@@ -57,4 +63,4 @@ class CachedMultilayerEDTFValidator(EDTFValidator):
57
63
  datetime.strptime(value, "%Y-%m-%d")
58
64
  return value
59
65
  except:
60
- return super().__call__(value)
66
+ return super().__call__(value)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: oarepo-runtime
3
- Version: 1.5.87
3
+ Version: 1.5.89
4
4
  Summary: A set of runtime extensions of Invenio repository
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE
@@ -103,7 +103,7 @@ oarepo_runtime/services/files/__init__.py,sha256=K8MStrEQf_BUhvzhwPTF93Hkhwrd1dt
103
103
  oarepo_runtime/services/files/components.py,sha256=x6Wd-vvkqTqB1phj2a6h42DNQksN8PuR2XKaOGoNHfw,2400
104
104
  oarepo_runtime/services/files/service.py,sha256=8DH0Pefr9kilM2JnOb-UYsnqerE8Z1Mu4p6DOJ4j_ZU,608
105
105
  oarepo_runtime/services/permissions/__init__.py,sha256=Cgin2Zr1fpaYr-aZcUotdmv0hsrPTUJVQt8ouvU8tuU,95
106
- oarepo_runtime/services/permissions/generators.py,sha256=OAJ_1W5eiLPkNvSXnWTDq0Z4-FU799qHa9tOufiOL3c,1722
106
+ oarepo_runtime/services/permissions/generators.py,sha256=y_jptL-pHDU91xJsLMR0Bfva5EXcZv6JDLZ1x7XxzKQ,1919
107
107
  oarepo_runtime/services/records/__init__.py,sha256=hIoa2fx1AkDr6c-MgY561U2oN9LFeUCtfbVnetpBUOg,78
108
108
  oarepo_runtime/services/records/links.py,sha256=gVe-_hGkLtX7pd6sS6jTbRIhBby2FTn9PXyYPy3yxzs,737
109
109
  oarepo_runtime/services/relations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -121,7 +121,7 @@ oarepo_runtime/services/schema/oneofschema.py,sha256=GnWH4Or_G5M0NgSmCoqMI6PBrJg
121
121
  oarepo_runtime/services/schema/polymorphic.py,sha256=bAbUoTIeDBiJPYPhpLEKKZekEdkHlpqkmNxk1hN3PDw,564
122
122
  oarepo_runtime/services/schema/rdm.py,sha256=4gi44LIMWS9kWcZfEoHaJSq585qfZfMuUYM5IvL1nQo,531
123
123
  oarepo_runtime/services/schema/ui.py,sha256=xQgW-zLyZoHldGw47uVtXQj-5LexVNKTholyq4MiBZo,3777
124
- oarepo_runtime/services/schema/validation.py,sha256=g2lpFwgQygWdLgq5bRvLAjVqXVOJpfVJ7umDp5xEGRU,1849
124
+ oarepo_runtime/services/schema/validation.py,sha256=VFOKSxQLHwFb7bW8BJAFXWe_iTAZFOfqOnb2Ko_Yxxc,2085
125
125
  oarepo_runtime/translations/default_translations.py,sha256=060GBlA1ghWxfeumo6NqxCCZDb-6OezOuF6pr-_GEOQ,104
126
126
  oarepo_runtime/translations/messages.pot,sha256=jyC7mRH5P9uwVVqz9ycvn-T8gcohr62x__O0sC6g2w4,1846
127
127
  oarepo_runtime/translations/cs/LC_MESSAGES/messages.mo,sha256=cSTRnVoi8DxfrXD-ImHYUmxdnNQMnxIn2yFRTObwRzI,801
@@ -135,9 +135,9 @@ tests/marshmallow_to_json/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
135
135
  tests/marshmallow_to_json/test_datacite_ui_schema.py,sha256=82iLj8nW45lZOUewpWbLX3mpSkpa9lxo-vK-Qtv_1bU,48552
136
136
  tests/marshmallow_to_json/test_simple_schema.py,sha256=izZN9p0v6kovtSZ6AdxBYmK_c6ZOti2_z_wPT_zXIr0,1500
137
137
  tests/pkg_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
138
- oarepo_runtime-1.5.87.dist-info/LICENSE,sha256=h2uWz0OaB3EN-J1ImdGJZzc7yvfQjvHVYdUhQ-H7ypY,1064
139
- oarepo_runtime-1.5.87.dist-info/METADATA,sha256=_q7RWXnC1qp9a_3JMIlX8P6dV5a-kSXXqo-_4c4pX6o,4720
140
- oarepo_runtime-1.5.87.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
141
- oarepo_runtime-1.5.87.dist-info/entry_points.txt,sha256=k7O5LZUOGsVeSpB7ulU0txBUNp1CVQG7Q7TJIVTPbzU,491
142
- oarepo_runtime-1.5.87.dist-info/top_level.txt,sha256=bHhlkT1_RQC4IkfTQCqA3iN4KCB6cSFQlsXpQMSP-bE,21
143
- oarepo_runtime-1.5.87.dist-info/RECORD,,
138
+ oarepo_runtime-1.5.89.dist-info/LICENSE,sha256=h2uWz0OaB3EN-J1ImdGJZzc7yvfQjvHVYdUhQ-H7ypY,1064
139
+ oarepo_runtime-1.5.89.dist-info/METADATA,sha256=2WAbKmJSznmufN3BQhjw5i4Sn_ZA_RRgkdwWuAOb0DY,4720
140
+ oarepo_runtime-1.5.89.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
141
+ oarepo_runtime-1.5.89.dist-info/entry_points.txt,sha256=k7O5LZUOGsVeSpB7ulU0txBUNp1CVQG7Q7TJIVTPbzU,491
142
+ oarepo_runtime-1.5.89.dist-info/top_level.txt,sha256=bHhlkT1_RQC4IkfTQCqA3iN4KCB6cSFQlsXpQMSP-bE,21
143
+ oarepo_runtime-1.5.89.dist-info/RECORD,,