collections: added task to compute num of records #5569
Annotations
4 errors
Python / Tests (3.9, postgresql14, opensearch2):
invenio_rdm_records/collections/tasks.py#L1
Black format check
--- /home/runner/work/invenio-rdm-records/invenio-rdm-records/invenio_rdm_records/collections/tasks.py 2024-10-25 11:04:42.228745+00:00
+++ /home/runner/work/invenio-rdm-records/invenio-rdm-records/invenio_rdm_records/collections/tasks.py 2024-10-25 11:26:07.769759+00:00
@@ -19,11 +19,13 @@
collections_service = current_rdm_records.collections_service
res = collections_service.read_all(system_identity, depth=0)
for citem in res:
try:
collection = citem._collection
- res = collections_service.search_collection_records(system_identity, collection)
+ res = collections_service.search_collection_records(
+ system_identity, collection
+ )
collections_service.update(
system_identity, collection, data={"num_records": res.total}
)
except Exception as e:
current_app.logger.exception(str(e))
|
Python / Tests (3.9, postgresql14, opensearch2)
Process completed with exit code 1.
|
Python / Tests (3.12, postgresql14, opensearch2):
invenio_rdm_records/collections/tasks.py#L1
Black format check
--- /home/runner/work/invenio-rdm-records/invenio-rdm-records/invenio_rdm_records/collections/tasks.py 2024-10-25 11:04:41.586312+00:00
+++ /home/runner/work/invenio-rdm-records/invenio-rdm-records/invenio_rdm_records/collections/tasks.py 2024-10-25 11:28:44.017407+00:00
@@ -19,11 +19,13 @@
collections_service = current_rdm_records.collections_service
res = collections_service.read_all(system_identity, depth=0)
for citem in res:
try:
collection = citem._collection
- res = collections_service.search_collection_records(system_identity, collection)
+ res = collections_service.search_collection_records(
+ system_identity, collection
+ )
collections_service.update(
system_identity, collection, data={"num_records": res.total}
)
except Exception as e:
current_app.logger.exception(str(e))
|
Python / Tests (3.12, postgresql14, opensearch2)
Process completed with exit code 1.
|