Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(metadata): Allows empty funding organization on submission #434

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion archive_api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]):
Expand Down
5 changes: 2 additions & 3 deletions archive_api/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ def test_client_post(self):
'contact',
'variables',
'ngee_tropics_resources',
'funding_organizations',
'originating_institution',
'qaqc_method_description']}, value)

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down
Loading