Skip to content

Commit ef545b7

Browse files
committed
pass profiles_path env variable to metadata testing function
1 parent 3838f11 commit ef545b7

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

app/ro_crates/routes/post_routes.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,6 @@ def validate_ro_crate_metadata(json_data) -> tuple[Response, int]:
111111
else:
112112
profile_name = None
113113

114-
return queue_ro_crate_metadata_validation_task(crate_json, profile_name)
114+
profiles_path = current_app.config["PROFILES_PATH"]
115+
116+
return queue_ro_crate_metadata_validation_task(crate_json, profile_name, profiles_path=profiles_path)

app/services/validation_service.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,15 @@ def queue_ro_crate_validation_task(
6161

6262

6363
def queue_ro_crate_metadata_validation_task(
64-
crate_json: str, profile_name=None, webhook_url=None
64+
crate_json: str, profile_name=None, webhook_url=None, profiles_path=None
6565
) -> tuple[Response, int]:
6666
"""
6767
Queues an RO-Crate for validation with Celery.
6868
6969
:param crate_id: The ID of the RO-Crate to validate.
7070
:param profile_name: The profile to validate against.
7171
:param webhook_url: The URL to POST the validation results to.
72+
:param profiles_path: A path to the profile definition directory.
7273
:return: A tuple containing a JSON response and an HTTP status code.
7374
:raises: Exception: If an error occurs whilst queueing the task.
7475
"""
@@ -90,7 +91,8 @@ def queue_ro_crate_metadata_validation_task(
9091
result = process_validation_task_by_metadata.delay(
9192
crate_json,
9293
profile_name,
93-
webhook_url
94+
webhook_url,
95+
profiles_path
9496
)
9597
if webhook_url:
9698
return jsonify({"message": "Validation in progress"}), 202

0 commit comments

Comments
 (0)