oarepo-runtime 1.9.1__py3-none-any.whl → 1.9.2__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.
@@ -13,7 +13,7 @@ class PublishWriter(BaseWriter):
13
13
  service,
14
14
  request_name="publish_draft",
15
15
  identity=None,
16
- direct_call=False,
16
+ direct_call=True,
17
17
  **kwargs
18
18
  ):
19
19
  if isinstance(service, str):
@@ -34,27 +34,31 @@ class PublishWriter(BaseWriter):
34
34
 
35
35
  def _write_entry(self, entry: StreamEntry):
36
36
  if self._direct_call:
37
- self._service.publish(self._identity, entry.id)
37
+ data = self._service.publish(self._identity, entry.id)
38
38
  else:
39
- from invenio_requests.proxies import (
40
- current_requests_service as current_invenio_requests_service,
41
- )
42
- from oarepo_requests.proxies import current_oarepo_requests_service
43
-
44
- draft = self._service.read_draft(self._identity, entry.id)
45
- request = current_oarepo_requests_service.create(
46
- identity=self._identity,
47
- data=None,
48
- request_type=self._request_name,
49
- topic=draft._record,
50
- )
51
-
52
- submit_result = current_invenio_requests_service.execute_action(
53
- self._identity, request.id, "submit"
54
- )
55
- accept_result = current_invenio_requests_service.execute_action(
56
- self._identity, request.id, "accept"
57
- )
58
-
59
- data = self._service.read(self._identity, draft["id"])
60
- entry.entry = data.to_dict()
39
+ data = self._publish_via_request(self._identity, entry.id)
40
+
41
+ entry.entry = data.to_dict()
42
+
43
+ def _publish_via_request(self, identity, entry_id):
44
+ from invenio_requests.proxies import (
45
+ current_requests_service as current_invenio_requests_service,
46
+ )
47
+ from oarepo_requests.proxies import current_oarepo_requests_service
48
+
49
+ draft = self._service.read_draft(identity, entry_id)
50
+ request = current_oarepo_requests_service.create(
51
+ identity=identity,
52
+ data=None,
53
+ request_type=self._request_name,
54
+ topic=draft._record,
55
+ )
56
+
57
+ submit_result = current_invenio_requests_service.execute_action(
58
+ identity, request.id, "submit"
59
+ )
60
+ accept_result = current_invenio_requests_service.execute_action(
61
+ identity, request.id, "accept"
62
+ )
63
+
64
+ return self._service.read(identity, draft["id"])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oarepo-runtime
3
- Version: 1.9.1
3
+ Version: 1.9.2
4
4
  Summary: A set of runtime extensions of Invenio repository
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE
@@ -42,7 +42,7 @@ oarepo_runtime/datastreams/readers/yaml.py,sha256=U4nyJQ8ocM_ohp-eUN1RjVoNzYV9z7
42
42
  oarepo_runtime/datastreams/writers/__init__.py,sha256=PWufWNrixFhXv5wSv3_pzmrimroqVB2DVgTxVtY5FCg,526
43
43
  oarepo_runtime/datastreams/writers/attachments_file.py,sha256=kV_IPAWawJ9PX-IfoncmLQXpdTbzRMsJie8uKX1vNp0,3161
44
44
  oarepo_runtime/datastreams/writers/attachments_service.py,sha256=g_tbjUA3YnTE5gP21zlG2kIxneZsn0q95EVjlxB8s1M,4152
45
- oarepo_runtime/datastreams/writers/publish.py,sha256=x_ipun8TQiYNvGokVnEppYw9ko1AyrSzHu3D8b3ZWzI,2126
45
+ oarepo_runtime/datastreams/writers/publish.py,sha256=XUuYjrbLMX77eIvY7I40On8SkrwpLuh2Y4yjltANcfE,2162
46
46
  oarepo_runtime/datastreams/writers/service.py,sha256=8oXGG365ro_XEoZUncFltule_6TAbPPbSr-SBgcbWRA,6224
47
47
  oarepo_runtime/datastreams/writers/utils.py,sha256=Lk_ZLNeXTLuFEn04lw1-6bJ7duG6kwA8X4wf9c_GiL4,1067
48
48
  oarepo_runtime/datastreams/writers/validation_errors.py,sha256=wOCXdniR6so_4ExpdFYYgBRyENp7_6kVFZM2L-Hy3G8,661
@@ -150,13 +150,13 @@ oarepo_runtime/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
150
150
  oarepo_runtime/utils/functools.py,sha256=gKS9YZtlIYcDvdNA9cmYO00yjiXBYV1jg8VpcRUyQyg,1324
151
151
  oarepo_runtime/utils/index.py,sha256=ArrUUXB-KowUcUksRKqcFpmqct4bn9alO1zd_kX2tmU,292
152
152
  oarepo_runtime/utils/path.py,sha256=V1NVyk3m12_YLbj7QHYvUpE1wScO78bYsX1LOLeXDkI,3108
153
- oarepo_runtime-1.9.1.dist-info/licenses/LICENSE,sha256=h2uWz0OaB3EN-J1ImdGJZzc7yvfQjvHVYdUhQ-H7ypY,1064
153
+ oarepo_runtime-1.9.2.dist-info/licenses/LICENSE,sha256=h2uWz0OaB3EN-J1ImdGJZzc7yvfQjvHVYdUhQ-H7ypY,1064
154
154
  tests/marshmallow_to_json/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
155
155
  tests/marshmallow_to_json/test_datacite_ui_schema.py,sha256=82iLj8nW45lZOUewpWbLX3mpSkpa9lxo-vK-Qtv_1bU,48552
156
156
  tests/marshmallow_to_json/test_simple_schema.py,sha256=izZN9p0v6kovtSZ6AdxBYmK_c6ZOti2_z_wPT_zXIr0,1500
157
157
  tests/pkg_data/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
158
- oarepo_runtime-1.9.1.dist-info/METADATA,sha256=DCAmzY63rEcjsSoxr_bpkHKn7fRsV_HNv7Xy4KYtx_k,4788
159
- oarepo_runtime-1.9.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
160
- oarepo_runtime-1.9.1.dist-info/entry_points.txt,sha256=k7O5LZUOGsVeSpB7ulU0txBUNp1CVQG7Q7TJIVTPbzU,491
161
- oarepo_runtime-1.9.1.dist-info/top_level.txt,sha256=bHhlkT1_RQC4IkfTQCqA3iN4KCB6cSFQlsXpQMSP-bE,21
162
- oarepo_runtime-1.9.1.dist-info/RECORD,,
158
+ oarepo_runtime-1.9.2.dist-info/METADATA,sha256=o-rT5Q2aByveCjJPC48lEVUE4GRgo_gLBom6k_gAExA,4788
159
+ oarepo_runtime-1.9.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
160
+ oarepo_runtime-1.9.2.dist-info/entry_points.txt,sha256=k7O5LZUOGsVeSpB7ulU0txBUNp1CVQG7Q7TJIVTPbzU,491
161
+ oarepo_runtime-1.9.2.dist-info/top_level.txt,sha256=bHhlkT1_RQC4IkfTQCqA3iN4KCB6cSFQlsXpQMSP-bE,21
162
+ oarepo_runtime-1.9.2.dist-info/RECORD,,