diff --git a/site/zenodo_rdm/curation/config.py b/site/zenodo_rdm/curation/config.py index 60056a15..bb846513 100644 --- a/site/zenodo_rdm/curation/config.py +++ b/site/zenodo_rdm/curation/config.py @@ -5,7 +5,7 @@ # ZenodoRDM is free software; you can redistribute it and/or modify # it under the terms of the MIT License; see LICENSE file for more details. -"""Moderation config.""" +"""Curation config.""" from .rules import ( additional_desc_contains_high_conf_keywords, diff --git a/site/zenodo_rdm/curation/tasks.py b/site/zenodo_rdm/curation/tasks.py index d65833db..9b461949 100644 --- a/site/zenodo_rdm/curation/tasks.py +++ b/site/zenodo_rdm/curation/tasks.py @@ -29,6 +29,8 @@ def run_eu_record_curation(since): } dry_run = not current_app.config.get("CURATION_ENABLE_EU_CURATOR") curator = EURecordCurator(dry=dry_run) + created_before = (datetime.now(timezone.utc) - timedelta(days=30)).isoformat() + updated_after = (datetime.fromisoformat(since) - timedelta(hours=12)).isoformat() query = dsl.Q( "bool", @@ -38,16 +40,13 @@ def run_eu_record_curation(since): dsl.Q( "range", created={ - "lte": ( - datetime.now(timezone.utc) - timedelta(days=30) - ).isoformat(), + "lte": created_before, }, ), dsl.Q( "range", updated={ - "gte": datetime.fromisoformat(since).isoformat() - - timedelta(hours=12), + "gte": updated_after, }, ), ],