oarepo-runtime 1.5.43__py3-none-any.whl → 1.5.44__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,8 @@
1
1
  from base64 import b64decode
2
2
 
3
3
  import requests
4
+ from deprecated import deprecated
5
+ from flask import current_app
4
6
  from invenio_drafts_resources.services import RecordService as DraftRecordService
5
7
  from invenio_records_resources.proxies import current_service_registry
6
8
  from invenio_records_resources.services import FileService, RecordService
@@ -12,7 +14,16 @@ from requests.adapters import BaseAdapter
12
14
  def get_record_service_for_record(record):
13
15
  if not record:
14
16
  return None
17
+ if "OAREPO_PRIMARY_RECORD_SERVICE" in current_app.config:
18
+ return current_app.config["OAREPO_PRIMARY_RECORD_SERVICE"][type(record)]
19
+ else:
20
+ return get_record_service_for_record_deprecated(record)
21
+
15
22
 
23
+ @deprecated(
24
+ version="1.5.43", reason="Please recompile model to remove this deprecation warning"
25
+ )
26
+ def get_record_service_for_record_deprecated(record):
16
27
  if getattr(record, "is_draft", False):
17
28
  record_name = "draft_cls"
18
29
  expect_draft_service = True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: oarepo-runtime
3
- Version: 1.5.43
3
+ Version: 1.5.44
4
4
  Summary: A set of runtime extensions of Invenio repository
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE
@@ -25,7 +25,7 @@ oarepo_runtime/datastreams/semi_asynchronous.py,sha256=TJWby2MDKXm5feRocoWB-8Ohs
25
25
  oarepo_runtime/datastreams/synchronous.py,sha256=t5lfnMkLqy3jK5zMl-nIuA0HlMPiHGjwCqZ8XQP-3GM,2595
26
26
  oarepo_runtime/datastreams/transformers.py,sha256=q5KzHPl2kJg7HP1BtKJ7F_UMqg_7L1ZGDX0O7s8D6UI,521
27
27
  oarepo_runtime/datastreams/types.py,sha256=KZjblc3T_UFFW7LrMDmiR8lqVf86V484LAHj6yg05EI,9908
28
- oarepo_runtime/datastreams/utils.py,sha256=Dg2q11YC8dQ4WNoHteI6dXlD-qChYucJrP6XR5oyxUE,3499
28
+ oarepo_runtime/datastreams/utils.py,sha256=PAUVyL6AuD20PtESJcUEXsUeeSnxxKUB9LzxqwAgx9U,3939
29
29
  oarepo_runtime/datastreams/readers/__init__.py,sha256=P1n3llZQ3AFHnSPbeT1VaCJcEtRFz9AbHfjkZv5LG7s,1103
30
30
  oarepo_runtime/datastreams/readers/attachments.py,sha256=A7EC1TqyTHG-go5DIaRotlBSOm6o9hGqAKyVVAceCRU,1956
31
31
  oarepo_runtime/datastreams/readers/excel.py,sha256=CM8lr8mejN7NgoK5TJb1oXpjq0HxklQKMsuj3uqjTjA,3653
@@ -117,9 +117,9 @@ oarepo_runtime/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
117
117
  oarepo_runtime/utils/functools.py,sha256=gKS9YZtlIYcDvdNA9cmYO00yjiXBYV1jg8VpcRUyQyg,1324
118
118
  oarepo_runtime/utils/path.py,sha256=V1NVyk3m12_YLbj7QHYvUpE1wScO78bYsX1LOLeXDkI,3108
119
119
  tests/pkg_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
120
- oarepo_runtime-1.5.43.dist-info/LICENSE,sha256=h2uWz0OaB3EN-J1ImdGJZzc7yvfQjvHVYdUhQ-H7ypY,1064
121
- oarepo_runtime-1.5.43.dist-info/METADATA,sha256=F2DEHBB8MB9qedtKvBbIplGSw9eVTehu59Ec8eucA-0,4680
122
- oarepo_runtime-1.5.43.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
123
- oarepo_runtime-1.5.43.dist-info/entry_points.txt,sha256=QrlXAKuPDVBinaSh_v3yO9_Nb9ZNmJCJ0VFcCW-z0Jg,327
124
- oarepo_runtime-1.5.43.dist-info/top_level.txt,sha256=bHhlkT1_RQC4IkfTQCqA3iN4KCB6cSFQlsXpQMSP-bE,21
125
- oarepo_runtime-1.5.43.dist-info/RECORD,,
120
+ oarepo_runtime-1.5.44.dist-info/LICENSE,sha256=h2uWz0OaB3EN-J1ImdGJZzc7yvfQjvHVYdUhQ-H7ypY,1064
121
+ oarepo_runtime-1.5.44.dist-info/METADATA,sha256=pDJg1hNUd-gXeg2V2bhwmr0aIofecKPJb_43bXQF4RQ,4680
122
+ oarepo_runtime-1.5.44.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
123
+ oarepo_runtime-1.5.44.dist-info/entry_points.txt,sha256=QrlXAKuPDVBinaSh_v3yO9_Nb9ZNmJCJ0VFcCW-z0Jg,327
124
+ oarepo_runtime-1.5.44.dist-info/top_level.txt,sha256=bHhlkT1_RQC4IkfTQCqA3iN4KCB6cSFQlsXpQMSP-bE,21
125
+ oarepo_runtime-1.5.44.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (70.3.0)
2
+ Generator: setuptools (71.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5