collections: added task to compute num of records #5569
Annotations
2 errors
Run tests:
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))
|
Run tests
Process completed with exit code 1.
|
Loading