From 4a1c0b8ad25cceae9c48b204648b1f8c5bd24dd0 Mon Sep 17 00:00:00 2001 From: ozgury Date: Thu, 14 Nov 2024 14:06:50 +0000 Subject: [PATCH] refactor: new local validation endpoint accepts user's api-token --- metabolights_utils/provider/submission_repository.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/metabolights_utils/provider/submission_repository.py b/metabolights_utils/provider/submission_repository.py index c5d02d3..2cd5bf0 100644 --- a/metabolights_utils/provider/submission_repository.py +++ b/metabolights_utils/provider/submission_repository.py @@ -431,6 +431,7 @@ def validate_study_v2( pool_period: int = 5, retry: int = 20, timeout: int = 30, + api_token: str = None, ): sub_path = f"/study-model/validation" @@ -451,8 +452,9 @@ def validate_study_v2( calculate_data_folder_size=False, calculate_metadata_size=False, ) - - api_header, error = self.get_api_token() + api_header = api_token + if not api_token: + api_header, error = self.get_api_token() api_name = "validation v2 get jwt token" jwt_token = None try: