From f8f510006bdc5fdbd3a6bc56bacdb583622549c5 Mon Sep 17 00:00:00 2001 From: Val Hendrix Date: Thu, 29 Aug 2024 12:33:19 -0700 Subject: [PATCH] bug(metadata): Allows empty funding organization on submission Before the use of a default funding organization this funding organization was required on Dataset Submission for review. Now it is no longer require since BER will be the default funding organization. Closes #432 --- archive_api/serializers.py | 2 +- archive_api/tests/test_api.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/archive_api/serializers.py b/archive_api/serializers.py index b9820ebb..08ca0ed3 100644 --- a/archive_api/serializers.py +++ b/archive_api/serializers.py @@ -169,7 +169,7 @@ def validate(self, data): errors['missingRequiredFields'].append("archive") for field in ['sites', 'authors', 'name', 'description', 'contact', 'variables', - 'ngee_tropics_resources', 'funding_organizations', 'originating_institution', + 'ngee_tropics_resources', 'originating_institution', 'access_level', 'qaqc_method_description']: # Check for required fields if field in data.keys(): if data[field] is None or (isinstance(data[field], (list, tuple, str)) and not data[field]): diff --git a/archive_api/tests/test_api.py b/archive_api/tests/test_api.py index 71f1110c..1336b233 100644 --- a/archive_api/tests/test_api.py +++ b/archive_api/tests/test_api.py @@ -226,7 +226,6 @@ def test_client_post(self): 'contact', 'variables', 'ngee_tropics_resources', - 'funding_organizations', 'originating_institution', 'qaqc_method_description']}, value) @@ -331,7 +330,7 @@ def test_user_workflow(self): self.assertEqual(status.HTTP_400_BAD_REQUEST, response.status_code) self.assertEqual( {'description': ['Description must be at least 100 words. Current count is 37.'], - 'missingRequiredFields': ['archive', 'authors', 'funding_organizations', 'originating_institution', + 'missingRequiredFields': ['archive', 'authors', 'originating_institution', 'qaqc_method_description']}, value) @@ -388,7 +387,7 @@ def test_admin_approve_workflow(self): value = json.loads(response.content.decode('utf-8')) self.assertEqual( {'description': ['Description must be at least 100 words. Current count is 37.'], - 'missingRequiredFields': ['archive', 'authors', 'funding_organizations', 'originating_institution', + 'missingRequiredFields': ['archive', 'authors', 'originating_institution', 'qaqc_method_description']}, value) self.assertEqual(status.HTTP_400_BAD_REQUEST, response.status_code)