From 24fc01e9fd762d165bbcaaff12352d6b2614b15d Mon Sep 17 00:00:00 2001 From: Benjamin Moody Date: Fri, 20 Sep 2024 15:52:36 -0400 Subject: [PATCH] ActiveProject: ethics_statement must be non-blank for submission. The ethics_statement field is required, and a project should not be submitted or published if the field is blank. Previously, ethics_statement was not included in REQUIRED_FIELDS but was handled separately. However, the previous code permitted blank HTML values (such as "

 

"), which are not allowed for fields in REQUIRED_FIELDS. Additionally, REQUIRED_FIELDS is reformatted for better readability. --- .../project/modelcomponents/activeproject.py | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/physionet-django/project/modelcomponents/activeproject.py b/physionet-django/project/modelcomponents/activeproject.py index 4ecd6942f..787656b22 100644 --- a/physionet-django/project/modelcomponents/activeproject.py +++ b/physionet-django/project/modelcomponents/activeproject.py @@ -162,21 +162,25 @@ class ActiveProject(Metadata, UnpublishedProject, SubmissionInfo): REQUIRED_FIELDS = ( # 0: Database - ('title', 'abstract', 'background', 'methods', 'content_description', - 'usage_notes', 'conflicts_of_interest', 'version', 'license', - 'short_description'), + ('title', 'abstract', 'background', + 'methods', 'content_description', 'usage_notes', + 'ethics_statement', 'conflicts_of_interest', + 'version', 'license', 'short_description'), # 1: Software - ('title', 'abstract', 'background', 'content_description', - 'usage_notes', 'installation', 'conflicts_of_interest', 'version', - 'license', 'short_description'), + ('title', 'abstract', 'background', + 'content_description', 'usage_notes', 'installation', + 'ethics_statement', 'conflicts_of_interest', + 'version', 'license', 'short_description'), # 2: Challenge - ('title', 'abstract', 'background', 'methods', 'content_description', - 'usage_notes', 'conflicts_of_interest', 'version', 'license', - 'short_description'), + ('title', 'abstract', 'background', + 'methods', 'content_description', 'usage_notes', + 'ethics_statement', 'conflicts_of_interest', + 'version', 'license', 'short_description'), # 3: Model - ('title', 'abstract', 'background', 'methods', 'content_description', - 'usage_notes', 'installation', 'conflicts_of_interest', 'version', - 'license', 'short_description'), + ('title', 'abstract', 'background', + 'methods', 'content_description', 'usage_notes', 'installation', + 'ethics_statement', 'conflicts_of_interest', + 'version', 'license', 'short_description'), ) # Custom labels that don't match model field names @@ -345,10 +349,6 @@ def check_integrity(self): l = self.LABELS[self.resource_type.id][attr] if attr in self.LABELS[self.resource_type.id] else attr.title().replace('_', ' ') self.integrity_errors.append('Missing required field: {0}'.format(l)) - # Ethics - if not self.ethics_statement: - self.integrity_errors.append('Missing required field: Ethics Statement') - published_projects = self.core_project.publishedprojects.all() if published_projects: published_versions = [p.version for p in published_projects]