oarepo-runtime 1.5.117__py3-none-any.whl → 1.5.119__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.
@@ -1,4 +1,5 @@
1
1
  import sys
2
+ import traceback
2
3
  from io import StringIO
3
4
 
4
5
  import click
@@ -7,7 +8,6 @@ from flask.cli import with_appcontext
7
8
  from invenio_db import db
8
9
  from invenio_records_resources.proxies import current_service_registry
9
10
  from invenio_search.proxies import current_search
10
- import traceback
11
11
  from werkzeug.utils import ImportStringError, import_string
12
12
 
13
13
  try:
@@ -157,7 +157,7 @@ def reindex(model, bulk_size, verbose):
157
157
  count += len(bulk) // 2
158
158
  for index_item_result in index_result["items"]:
159
159
  result = index_item_result["index"]
160
- if result["status"] != 200:
160
+ if result["status"] not in (200, 201):
161
161
  errors += 1
162
162
  click.secho(
163
163
  f"Error indexing record with id {result['_id']}",
@@ -245,11 +245,9 @@ def users_record_generator(model_class):
245
245
  except Exception as e:
246
246
  click.secho(f"Could not index {model_class}: {e}", fg="red", file=sys.stderr)
247
247
 
248
- priorities = [
249
- 'vocabular',
250
- 'users',
251
- 'groups'
252
- ]
248
+
249
+ priorities = ["vocabular", "users", "groups"]
250
+
253
251
 
254
252
  def sort_services(services):
255
253
  def idx(x):
@@ -257,7 +255,9 @@ def sort_services(services):
257
255
  if p in x:
258
256
  return idx, x
259
257
  return len(priorities), x
258
+
260
259
  services.sort(key=idx)
261
260
  return services
262
261
 
262
+
263
263
  RECORD_GENERATORS = {"users": users_record_generator}
@@ -186,7 +186,7 @@ class UnstrictRelationResult(RelationResult):
186
186
  return relation.value
187
187
  relation_id = self._lookup_id(relation)
188
188
  resolved_object = self.resolve(relation_id, relation.value)
189
- if not resolved_object:
189
+ if resolved_object is None:
190
190
  raise InvalidRelationValue(f"Could not resolve relation id {relation_id}.")
191
191
  return resolved_object
192
192
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: oarepo-runtime
3
- Version: 1.5.117
3
+ Version: 1.5.119
4
4
  Summary: A set of runtime extensions of Invenio repository
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE
@@ -12,7 +12,7 @@ oarepo_runtime/cli/cf.py,sha256=W0JEJK2JqKubQw8qtZJxohmADDRUBode4JZAqYLDGvc,339
12
12
  oarepo_runtime/cli/check.py,sha256=sCe2PeokSHvNOXHFZ8YHF8NMhsu5nYjyuZuvXHJ6X18,5092
13
13
  oarepo_runtime/cli/configuration.py,sha256=M_19zrS0vo-7uHi047a3i4rQsK6pmp4QS0IEBAxMLZ0,2039
14
14
  oarepo_runtime/cli/fixtures.py,sha256=l6zHpz1adjotrbFy_wcN2TOL8x20i-1jbQmaoEEo-UU,5419
15
- oarepo_runtime/cli/index.py,sha256=KH5PArp0fCNbgJI1zSz0pb69U9eyCdnJuy0aMIgf2tg,8685
15
+ oarepo_runtime/cli/index.py,sha256=9Dqbe1dVrz-TcZkXCGYe4qm4sVxJRWnTzzr9OEaIko8,8686
16
16
  oarepo_runtime/cli/validate.py,sha256=HpSvHQCGHlrdgdpKix9cIlzlBoJEiT1vACZdMnOUGEY,2827
17
17
  oarepo_runtime/cli/permissions/__init__.py,sha256=2qufYdUoCb9kG7Zy0gKNW5lpRyqbVQSNsf7shLwrThM,198
18
18
  oarepo_runtime/cli/permissions/base.py,sha256=USzA5LNFPpR7tvM_uan70GI7oO6FrGlHzODU_Z4Tl6c,744
@@ -63,7 +63,7 @@ oarepo_runtime/records/mappings/rdm_parent_mapping.json,sha256=9yRjlGs8-TZZiKN9M
63
63
  oarepo_runtime/records/owners/__init__.py,sha256=R4hudCBqLRRzgCnkEjXIL7hSp068z-s6YOwYSkWyuaw,93
64
64
  oarepo_runtime/records/owners/registry.py,sha256=fYgBuW5nBKn6pyz2OBgfNlynk64_yhQ9J7FzPk8QU1U,795
65
65
  oarepo_runtime/records/relations/__init__.py,sha256=Zn7JeQrd5f1doWl5IpbNSpO8m8hm1m-oljAW-7WHn-k,477
66
- oarepo_runtime/records/relations/base.py,sha256=H_8OPO35WQlbvnDi1LKltmCgoBn1HF40b03xveH09p0,9998
66
+ oarepo_runtime/records/relations/base.py,sha256=DDU1T8hcwMFTIiFQqGTzNEoWTeYnO0fK-xZLmt5-3SM,10002
67
67
  oarepo_runtime/records/relations/internal.py,sha256=OTp8iJqyl80sWDk0Q0AK42l6UsxZDABspVU_GwWza9o,1556
68
68
  oarepo_runtime/records/relations/lookup.py,sha256=wi3jPfOedazOmhOMrgu50PUETc1jfSdpmjK0wvOFsEM,848
69
69
  oarepo_runtime/records/relations/pid_relation.py,sha256=eojw5uIo5zXmJGge_bj6Wj2njCRY5S4o4B_h_HFyaDY,3901
@@ -148,9 +148,9 @@ tests/marshmallow_to_json/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
148
148
  tests/marshmallow_to_json/test_datacite_ui_schema.py,sha256=82iLj8nW45lZOUewpWbLX3mpSkpa9lxo-vK-Qtv_1bU,48552
149
149
  tests/marshmallow_to_json/test_simple_schema.py,sha256=izZN9p0v6kovtSZ6AdxBYmK_c6ZOti2_z_wPT_zXIr0,1500
150
150
  tests/pkg_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
151
- oarepo_runtime-1.5.117.dist-info/LICENSE,sha256=h2uWz0OaB3EN-J1ImdGJZzc7yvfQjvHVYdUhQ-H7ypY,1064
152
- oarepo_runtime-1.5.117.dist-info/METADATA,sha256=-s_-K_vzg58ylIqaV1IsY4lRLFCOonbvEU5sfHlt4wI,4721
153
- oarepo_runtime-1.5.117.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
154
- oarepo_runtime-1.5.117.dist-info/entry_points.txt,sha256=k7O5LZUOGsVeSpB7ulU0txBUNp1CVQG7Q7TJIVTPbzU,491
155
- oarepo_runtime-1.5.117.dist-info/top_level.txt,sha256=bHhlkT1_RQC4IkfTQCqA3iN4KCB6cSFQlsXpQMSP-bE,21
156
- oarepo_runtime-1.5.117.dist-info/RECORD,,
151
+ oarepo_runtime-1.5.119.dist-info/LICENSE,sha256=h2uWz0OaB3EN-J1ImdGJZzc7yvfQjvHVYdUhQ-H7ypY,1064
152
+ oarepo_runtime-1.5.119.dist-info/METADATA,sha256=JLNSQGtP-9Be6t43OwPpmQUKWkiWf5Hb5ZGILOcd87g,4721
153
+ oarepo_runtime-1.5.119.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
154
+ oarepo_runtime-1.5.119.dist-info/entry_points.txt,sha256=k7O5LZUOGsVeSpB7ulU0txBUNp1CVQG7Q7TJIVTPbzU,491
155
+ oarepo_runtime-1.5.119.dist-info/top_level.txt,sha256=bHhlkT1_RQC4IkfTQCqA3iN4KCB6cSFQlsXpQMSP-bE,21
156
+ oarepo_runtime-1.5.119.dist-info/RECORD,,