From c2731682b944640c78db644f7e2555081f5b7470 Mon Sep 17 00:00:00 2001 From: lamawmouk Date: Tue, 8 Nov 2022 23:36:20 -0500 Subject: [PATCH 01/32] adds dua template to project files page. --- physionet-django/templates/about/files.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/physionet-django/templates/about/files.html b/physionet-django/templates/about/files.html index 15660fad2e..7afd974a60 100644 --- a/physionet-django/templates/about/files.html +++ b/physionet-django/templates/about/files.html @@ -20,3 +20,15 @@
  • Provide a list of all WFDB format records, named RECORDS. Example file. If you upload this file, you will see a link to view your project's waveforms in LightWAVE.
  • Provide a tab delimited list of all WFDB format annotation files, named ANNOTATORS. Example file.
  • + +PhysioNet Data Upload and Sharing Agreement + \ No newline at end of file From af827a832b0f442ef2421ed20ffa68ff13d4fe36 Mon Sep 17 00:00:00 2001 From: lamawmouk Date: Wed, 9 Nov 2022 11:26:49 -0500 Subject: [PATCH 02/32] adds model to store responses from dua before project submission --- .../project/modelcomponents/submission.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/physionet-django/project/modelcomponents/submission.py b/physionet-django/project/modelcomponents/submission.py index f18cf1387e..a05ac43f5b 100644 --- a/physionet-django/project/modelcomponents/submission.py +++ b/physionet-django/project/modelcomponents/submission.py @@ -255,3 +255,18 @@ def quota_manager(self): creation_time=self.creation_datetime) quota_manager.set_limits(bytes_hard=limit, bytes_soft=limit) return quota_manager + + +class DataUseAgreement(models.Model): + """This model is used to store the responses from the data use agreement for the project.""" + RESPONSE_CHOICES = ( + (0, 'No'), + (1, 'Yes'), + (2, 'NA'), + ) + + project = models.OneToOneField('project.ActiveProject', on_delete=models.CASCADE) + has_copy_right_permission = models.PositiveSmallIntegerField(choices = RESPONSE_CHOICES) + has_human_subject_data=models.PositiveSmallIntegerField(choices = RESPONSE_CHOICES) + has_phi=models.PositiveSmallIntegerField(choices = RESPONSE_CHOICES) + \ No newline at end of file From d5f9db657cc4b0ec7def2c10e90138208bd9c764 Mon Sep 17 00:00:00 2001 From: lamawmouk Date: Wed, 9 Nov 2022 11:28:45 -0500 Subject: [PATCH 03/32] adds migration to apply changes to the model into the database schema. --- .../migrations/0064_datauseagreement.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 physionet-django/project/migrations/0064_datauseagreement.py diff --git a/physionet-django/project/migrations/0064_datauseagreement.py b/physionet-django/project/migrations/0064_datauseagreement.py new file mode 100644 index 0000000000..6db3ca8eff --- /dev/null +++ b/physionet-django/project/migrations/0064_datauseagreement.py @@ -0,0 +1,24 @@ +# Generated by Django 3.1.14 on 2022-11-09 16:22 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('project', '0063_auto_20220528_2248'), + ] + + operations = [ + migrations.CreateModel( + name='DataUseAgreement', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('has_copy_right_permission', models.PositiveSmallIntegerField(choices=[(0, 'No'), (1, 'Yes'), (2, 'NA')])), + ('has_human_subject_data', models.PositiveSmallIntegerField(choices=[(0, 'No'), (1, 'Yes'), (2, 'NA')])), + ('has_phi', models.PositiveSmallIntegerField(choices=[(0, 'No'), (1, 'Yes'), (2, 'NA')])), + ('project', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='project.activeproject')), + ], + ), + ] From b08f10564d203064ea9d5a2ad8bf50e38fa17f10 Mon Sep 17 00:00:00 2001 From: lamawmouk Date: Wed, 9 Nov 2022 19:52:59 -0500 Subject: [PATCH 04/32] fixes styling --- .../project/migrations/0064_datauseagreement.py | 6 ++++-- .../project/modelcomponents/submission.py | 13 ++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/physionet-django/project/migrations/0064_datauseagreement.py b/physionet-django/project/migrations/0064_datauseagreement.py index 6db3ca8eff..85e019e1e5 100644 --- a/physionet-django/project/migrations/0064_datauseagreement.py +++ b/physionet-django/project/migrations/0064_datauseagreement.py @@ -15,8 +15,10 @@ class Migration(migrations.Migration): name='DataUseAgreement', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('has_copy_right_permission', models.PositiveSmallIntegerField(choices=[(0, 'No'), (1, 'Yes'), (2, 'NA')])), - ('has_human_subject_data', models.PositiveSmallIntegerField(choices=[(0, 'No'), (1, 'Yes'), (2, 'NA')])), + ('has_copy_right_permission', models.PositiveSmallIntegerField( + choices=[(0, 'No'), (1, 'Yes'),(2, 'NA')])), + ('has_human_subject_data', models.PositiveSmallIntegerField( + choices=[(0, 'No'), (1, 'Yes'), (2, 'NA')])), ('has_phi', models.PositiveSmallIntegerField(choices=[(0, 'No'), (1, 'Yes'), (2, 'NA')])), ('project', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='project.activeproject')), ], diff --git a/physionet-django/project/modelcomponents/submission.py b/physionet-django/project/modelcomponents/submission.py index a05ac43f5b..df8fd7f138 100644 --- a/physionet-django/project/modelcomponents/submission.py +++ b/physionet-django/project/modelcomponents/submission.py @@ -260,13 +260,12 @@ def quota_manager(self): class DataUseAgreement(models.Model): """This model is used to store the responses from the data use agreement for the project.""" RESPONSE_CHOICES = ( - (0, 'No'), - (1, 'Yes'), - (2, 'NA'), - ) + (0, 'No'), + (1, 'Yes'), + (2, 'NA'), + ) project = models.OneToOneField('project.ActiveProject', on_delete=models.CASCADE) has_copy_right_permission = models.PositiveSmallIntegerField(choices = RESPONSE_CHOICES) - has_human_subject_data=models.PositiveSmallIntegerField(choices = RESPONSE_CHOICES) - has_phi=models.PositiveSmallIntegerField(choices = RESPONSE_CHOICES) - \ No newline at end of file + has_human_subject_data = models.PositiveSmallIntegerField(choices = RESPONSE_CHOICES) + has_phi = models.PositiveSmallIntegerField(choices = RESPONSE_CHOICES) From 956827e82f9d8c04833a21f22c29265e69dcfce4 Mon Sep 17 00:00:00 2001 From: lamawmouk Date: Tue, 15 Nov 2022 17:42:24 -0500 Subject: [PATCH 05/32] initial data upload agreement --- physionet-django/project/forms.py | 15 +++++++++++++++ .../project/modelcomponents/submission.py | 17 +++++++++++------ .../templates/project/project_files.html | 1 + physionet-django/project/views.py | 13 +++++++++++++ physionet-django/templates/about/files.html | 11 ----------- 5 files changed, 40 insertions(+), 17 deletions(-) diff --git a/physionet-django/project/forms.py b/physionet-django/project/forms.py index 95261eff23..2a28c3e619 100644 --- a/physionet-django/project/forms.py +++ b/physionet-django/project/forms.py @@ -39,6 +39,7 @@ Topic, exists_project_slug, UploadedDocument, + DataUseAgreement ) from project.projectfiles import ProjectFiles from user.models import User, TrainingType @@ -1175,3 +1176,17 @@ def __init__(self, *args, **kwargs): "Statements on ethics approval should appear here. " "Your statement will be included in the public project description." ) +class UploadedAgreementDataForm(forms.ModelForm): + class Meta: + model = DataUseAgreement + fields = ( + 'has_copy_right_permission', + 'has_human_subject_data', + 'has_phi' + ) + labels = {'has_copy_right_permission': 'Are you the original creator, or copyright holder, or have permission from the creators and copyright holders to share these files?', + 'has_human_subject_data':'Does this project contain data collected from human subjects?', + 'has_phi':'Do these files contain any personally identifiable information (information that could identify individual human subjects)?'} + def __init__(self, project, *args, **kwargs): + super().__init__(*args, **kwargs) + self.project = project diff --git a/physionet-django/project/modelcomponents/submission.py b/physionet-django/project/modelcomponents/submission.py index df8fd7f138..907cd692d6 100644 --- a/physionet-django/project/modelcomponents/submission.py +++ b/physionet-django/project/modelcomponents/submission.py @@ -259,13 +259,18 @@ def quota_manager(self): class DataUseAgreement(models.Model): """This model is used to store the responses from the data use agreement for the project.""" - RESPONSE_CHOICES = ( - (0, 'No'), - (1, 'Yes'), + RESPONSE_CHOICES_1_and_2= ( + (0, 'Yes'), + (1, 'No'), + ) + RESPONSE_CHOICES_3 = ( + (0, 'Yes'), + (1, 'No'), (2, 'NA'), ) + project = models.OneToOneField('project.ActiveProject', on_delete=models.CASCADE) - has_copy_right_permission = models.PositiveSmallIntegerField(choices = RESPONSE_CHOICES) - has_human_subject_data = models.PositiveSmallIntegerField(choices = RESPONSE_CHOICES) - has_phi = models.PositiveSmallIntegerField(choices = RESPONSE_CHOICES) + has_copy_right_permission = models.PositiveSmallIntegerField(choices = RESPONSE_CHOICES_1_and_2) + has_human_subject_data = models.PositiveSmallIntegerField(choices = RESPONSE_CHOICES_1_and_2) + has_phi = models.PositiveSmallIntegerField(choices = RESPONSE_CHOICES_3) diff --git a/physionet-django/project/templates/project/project_files.html b/physionet-django/project/templates/project/project_files.html index 61b8565a18..97a8bde6e7 100644 --- a/physionet-django/project/templates/project/project_files.html +++ b/physionet-django/project/templates/project/project_files.html @@ -35,6 +35,7 @@ {{ maintenance_message }} {% endif %} +{% include "project/upload_data_agreement.html" %}
    {% include "project/project_storage_allowance.html" %} diff --git a/physionet-django/project/views.py b/physionet-django/project/views.py index 63a7d2c0ca..20801d99c8 100644 --- a/physionet-django/project/views.py +++ b/physionet-django/project/views.py @@ -1036,6 +1036,15 @@ def project_files(request, project_slug, subdir='', **kwargs): if storage_request: storage_request.get().delete() messages.success(request, 'Your storage request has been cancelled.') + elif 'submit_upload_agreement' in request.POST: + upload_agreement_form = forms.UploadedAgreementDataForm(project=project, + data=request.POST) + if upload_agreement_form.is_valid(): + upload_agreement_form.instance.project = project + upload_agreement_form.save() + messages.success(request, 'Your upload agreement has been received.') + else: + messages.error(request, utility.get_form_errors(upload_agreement_form)) else: # process the file manipulation post subdir = process_files_post(request, project) @@ -1061,6 +1070,9 @@ def project_files(request, project_slug, subdir='', **kwargs): storage_request_form = ( forms.StorageRequestForm(project=project) if (not storage_request and is_submitting) else None ) + upload_agreement_form = ( + forms.UploadedAgreementDataForm(project=project) + ) (display_files, display_dirs, dir_breadcrumbs, parent_dir, file_error) = get_project_file_info(project=project, subdir=subdir) @@ -1096,6 +1108,7 @@ def project_files(request, project_slug, subdir='', **kwargs): 'maintenance_message': maintenance_message, 'is_lightwave_supported': ProjectFiles().is_lightwave_supported(), 'storage_type': settings.STORAGE_TYPE, + 'upload_agreement_form': upload_agreement_form, }, ) diff --git a/physionet-django/templates/about/files.html b/physionet-django/templates/about/files.html index 7afd974a60..b559cb1f45 100644 --- a/physionet-django/templates/about/files.html +++ b/physionet-django/templates/about/files.html @@ -21,14 +21,3 @@
  • Provide a tab delimited list of all WFDB format annotation files, named ANNOTATORS. Example file.
  • -PhysioNet Data Upload and Sharing Agreement -
      -
    • Please fill in the project agreement form. -
    • -
      -

      - -

      -
    \ No newline at end of file From 3d4ef1ae70258d6e9c015f9d26b44261da453289 Mon Sep 17 00:00:00 2001 From: lamawmouk Date: Tue, 29 Nov 2022 14:21:48 -0500 Subject: [PATCH 06/32] add the data upload agreement to projects --- physionet-django/project/forms.py | 4 +-- ...reement.py => 0064_datauploadagreement.py} | 12 +++---- .../project/modelcomponents/activeproject.py | 9 ++++- .../project/modelcomponents/submission.py | 3 +- .../project/upload_data_agreement.html | 34 +++++++++++++++++++ physionet-django/project/views.py | 10 ++++-- 6 files changed, 57 insertions(+), 15 deletions(-) rename physionet-django/project/migrations/{0064_datauseagreement.py => 0064_datauploadagreement.py} (71%) create mode 100644 physionet-django/project/templates/project/upload_data_agreement.html diff --git a/physionet-django/project/forms.py b/physionet-django/project/forms.py index 2a28c3e619..aff920a022 100644 --- a/physionet-django/project/forms.py +++ b/physionet-django/project/forms.py @@ -39,7 +39,7 @@ Topic, exists_project_slug, UploadedDocument, - DataUseAgreement + DataUploadAgreement ) from project.projectfiles import ProjectFiles from user.models import User, TrainingType @@ -1178,7 +1178,7 @@ def __init__(self, *args, **kwargs): ) class UploadedAgreementDataForm(forms.ModelForm): class Meta: - model = DataUseAgreement + model = DataUploadAgreement fields = ( 'has_copy_right_permission', 'has_human_subject_data', diff --git a/physionet-django/project/migrations/0064_datauseagreement.py b/physionet-django/project/migrations/0064_datauploadagreement.py similarity index 71% rename from physionet-django/project/migrations/0064_datauseagreement.py rename to physionet-django/project/migrations/0064_datauploadagreement.py index 85e019e1e5..3b8eedd1d5 100644 --- a/physionet-django/project/migrations/0064_datauseagreement.py +++ b/physionet-django/project/migrations/0064_datauploadagreement.py @@ -1,4 +1,4 @@ -# Generated by Django 3.1.14 on 2022-11-09 16:22 +# Generated by Django 3.1.14 on 2022-11-29 18:54 from django.db import migrations, models import django.db.models.deletion @@ -12,14 +12,12 @@ class Migration(migrations.Migration): operations = [ migrations.CreateModel( - name='DataUseAgreement', + name='DataUploadAgreement', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('has_copy_right_permission', models.PositiveSmallIntegerField( - choices=[(0, 'No'), (1, 'Yes'),(2, 'NA')])), - ('has_human_subject_data', models.PositiveSmallIntegerField( - choices=[(0, 'No'), (1, 'Yes'), (2, 'NA')])), - ('has_phi', models.PositiveSmallIntegerField(choices=[(0, 'No'), (1, 'Yes'), (2, 'NA')])), + ('has_copy_right_permission', models.PositiveSmallIntegerField(choices=[(0, 'Yes'), (1, 'No')])), + ('has_human_subject_data', models.PositiveSmallIntegerField(choices=[(0, 'Yes'), (1, 'No')])), + ('has_phi', models.PositiveSmallIntegerField(choices=[(0, 'Yes'), (1, 'No'), (2, 'NA')])), ('project', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='project.activeproject')), ], ), diff --git a/physionet-django/project/modelcomponents/activeproject.py b/physionet-django/project/modelcomponents/activeproject.py index 2ece76d93c..1797d04034 100644 --- a/physionet-django/project/modelcomponents/activeproject.py +++ b/physionet-django/project/modelcomponents/activeproject.py @@ -26,7 +26,7 @@ UploadedDocument, ) from project.modelcomponents.publishedproject import PublishedProject -from project.modelcomponents.submission import CopyeditLog, EditLog, SubmissionInfo +from project.modelcomponents.submission import CopyeditLog, EditLog, SubmissionInfo, DataUploadAgreement from project.modelcomponents.unpublishedproject import UnpublishedProject from project.projectfiles import ProjectFiles from project.validators import validate_subdir @@ -329,6 +329,13 @@ def check_integrity(self): f'Corresponding author {author.user.username} ' 'has not set a corresponding email') + #Data Upload Agreement + try: + DataUploadAgreement.objects.get(project_id=self.id) + except: #DataUseAgreement.ObjectDdoestNotExist: + self.integrity_errors.append('Missing required field: Data Upload Agreement') + + # Metadata for attr in ActiveProject.REQUIRED_FIELDS[self.resource_type.id]: value = getattr(self, attr) diff --git a/physionet-django/project/modelcomponents/submission.py b/physionet-django/project/modelcomponents/submission.py index 907cd692d6..f85329f188 100644 --- a/physionet-django/project/modelcomponents/submission.py +++ b/physionet-django/project/modelcomponents/submission.py @@ -257,7 +257,7 @@ def quota_manager(self): return quota_manager -class DataUseAgreement(models.Model): +class DataUploadAgreement(models.Model): """This model is used to store the responses from the data use agreement for the project.""" RESPONSE_CHOICES_1_and_2= ( (0, 'Yes'), @@ -268,7 +268,6 @@ class DataUseAgreement(models.Model): (1, 'No'), (2, 'NA'), ) - project = models.OneToOneField('project.ActiveProject', on_delete=models.CASCADE) has_copy_right_permission = models.PositiveSmallIntegerField(choices = RESPONSE_CHOICES_1_and_2) diff --git a/physionet-django/project/templates/project/upload_data_agreement.html b/physionet-django/project/templates/project/upload_data_agreement.html new file mode 100644 index 0000000000..46484b8627 --- /dev/null +++ b/physionet-django/project/templates/project/upload_data_agreement.html @@ -0,0 +1,34 @@ +PhysioNet Data Upload and Sharing Agreement +
      +
    • Please fill in the project agreement form. +
    • +
      + +

      + \ No newline at end of file diff --git a/physionet-django/project/views.py b/physionet-django/project/views.py index 20801d99c8..2ff497c0a1 100644 --- a/physionet-django/project/views.py +++ b/physionet-django/project/views.py @@ -48,7 +48,7 @@ Reference, StorageRequest, Topic, - UploadedDocument, + UploadedDocument,DataUploadAgreement ) from project.projectfiles import ProjectFiles from project.validators import validate_filename, validate_gcs_bucket_object @@ -1036,9 +1036,13 @@ def project_files(request, project_slug, subdir='', **kwargs): if storage_request: storage_request.get().delete() messages.success(request, 'Your storage request has been cancelled.') - elif 'submit_upload_agreement' in request.POST: + elif 'submit_upload_agreement' in request.POST: + try: + agreement= DataUploadAgreement.objects.get(project=project) + except DataUploadAgreement.DoesNotExist: + agreement = None upload_agreement_form = forms.UploadedAgreementDataForm(project=project, - data=request.POST) + data=request.POST, instance=agreement) if upload_agreement_form.is_valid(): upload_agreement_form.instance.project = project upload_agreement_form.save() From 5200a8ac212306ce284ebedd2cf5858832cf75f2 Mon Sep 17 00:00:00 2001 From: lamawmouk Date: Tue, 29 Nov 2022 16:25:27 -0500 Subject: [PATCH 07/32] adding demo for fixtures to datauploadagreement --- physionet-django/project/fixtures/demo-project.json | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/physionet-django/project/fixtures/demo-project.json b/physionet-django/project/fixtures/demo-project.json index dd9eee62bd..10376f8e68 100644 --- a/physionet-django/project/fixtures/demo-project.json +++ b/physionet-django/project/fixtures/demo-project.json @@ -2249,5 +2249,16 @@ "responder": null, "responder_comments": "" } +}, +{ + "model": "project.datauploadagreement", + "pk": 1, + "fields": { + "project": 1, + "has_copy_right_permission":0, + "has_human_subject_data":0, + "has_phi":1 + } } ] + From a5d99df5b5c6c23f576341e7f69b8b12f99092cd Mon Sep 17 00:00:00 2001 From: lamawmouk Date: Fri, 2 Dec 2022 17:17:32 -0500 Subject: [PATCH 08/32] fixed the data upload button --- .../project/templates/project/upload_data_agreement.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/physionet-django/project/templates/project/upload_data_agreement.html b/physionet-django/project/templates/project/upload_data_agreement.html index 46484b8627..4d665a966d 100644 --- a/physionet-django/project/templates/project/upload_data_agreement.html +++ b/physionet-django/project/templates/project/upload_data_agreement.html @@ -4,7 +4,7 @@

    -
    \ No newline at end of file + + \ No newline at end of file From d224ae922becaf74268de38e58899d728cf2fd69 Mon Sep 17 00:00:00 2001 From: lamawmouk Date: Tue, 6 Dec 2022 15:38:29 -0500 Subject: [PATCH 09/32] adds the data upload agreement for a new active project --- physionet-django/console/test_views.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/physionet-django/console/test_views.py b/physionet-django/console/test_views.py index cdbe89679c..4947879b6d 100644 --- a/physionet-django/console/test_views.py +++ b/physionet-django/console/test_views.py @@ -385,7 +385,13 @@ def test_publish_with_versions(self): response = self.client.post( reverse('new_project_version', args=(self.PROJECT_SLUG,)), data={'version': version}) + project = ActiveProject.objects.get(title='MIT-BIH Arrhythmia Database') + self.client.post(reverse('project_files',args=(project.slug,)), #gives the url #tuple need , + data= + {'has_copy_right_permission': '0', #put in teh request post + 'has_human_subject_data':'0', 'has_phi':'0' , 'submit_upload_agreement': 'submitbutton'}) #html submission #form fields were submitting too self.test_publish() + # Sort the list of version numbers sorted_versions = [] From b3e60eb761afaf3db73ae7a39407f1b72da01509 Mon Sep 17 00:00:00 2001 From: lamawmouk Date: Tue, 6 Dec 2022 17:29:57 -0500 Subject: [PATCH 10/32] restructures project file with data uploadagreement at top --- physionet-django/project/templates/project/project_files.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physionet-django/project/templates/project/project_files.html b/physionet-django/project/templates/project/project_files.html index 97a8bde6e7..98dbb4884f 100644 --- a/physionet-django/project/templates/project/project_files.html +++ b/physionet-django/project/templates/project/project_files.html @@ -19,6 +19,7 @@ {% block main_content %}
    +{% include "project/upload_data_agreement.html" %} {% include "about/files.html" %}
    @@ -35,7 +36,6 @@ {{ maintenance_message }} {% endif %} -{% include "project/upload_data_agreement.html" %}
    {% include "project/project_storage_allowance.html" %} From 0daf6d3ba927f6d5803f568fe5e8d6c703fd17b5 Mon Sep 17 00:00:00 2001 From: Dana Date: Wed, 14 Dec 2022 03:59:44 -0500 Subject: [PATCH 11/32] fixes styling issues for changed files --- physionet-django/console/test_views.py | 41 ++++++++----------- physionet-django/project/forms.py | 15 ++++--- .../project/modelcomponents/activeproject.py | 5 +-- .../project/modelcomponents/submission.py | 8 ++-- physionet-django/project/views.py | 5 ++- 5 files changed, 37 insertions(+), 37 deletions(-) diff --git a/physionet-django/console/test_views.py b/physionet-django/console/test_views.py index 4947879b6d..33cbb31f0a 100644 --- a/physionet-django/console/test_views.py +++ b/physionet-django/console/test_views.py @@ -64,7 +64,7 @@ def test_reassign_editor(self): # Submit project project = ActiveProject.objects.get(title='MIT-BIH Arrhythmia Database') project.submit(author_comments='') - # Assign editor + # Assign editorgi self.client.login(username='admin', password='Tester11!') editor = User.objects.get(username='cindyehlert') response = self.client.post(reverse('submitted_projects'), data={ @@ -212,8 +212,8 @@ def test_copyedit(self): # Recomplete copyedit response = self.client.post(reverse( 'copyedit_submission', args=(project.slug,)), - data={'complete_copyedit':'', 'made_changes':1, - 'changelog_summary':'Removed your things'}) + data={'complete_copyedit': '', 'made_changes':1, + 'changelog_summary': 'Removed your things'}) project = ActiveProject.objects.get(id=project.id) self.assertFalse(project.copyeditable()) @@ -261,7 +261,7 @@ def get_project(): # Complete copyedit response = self.client.post(reverse( 'copyedit_submission', args=(project.slug,)), - data={'complete_copyedit':'', 'made_changes':0}) + data={'complete_copyedit': '', 'made_changes': 0}) self.assertEqual(get_project().modified_datetime, timestamp) # Approve publication @@ -269,7 +269,7 @@ def get_project(): self.client.login(username='rgmark', password='Tester11!') response = self.client.post(reverse( 'project_submission', args=(project.slug,)), - data={'approve_publication':''}) + data={'approve_publication': ''}) self.assertEqual(get_project().modified_datetime, timestamp) self.assertTrue(ActiveProject.objects.get(id=project.id).is_publishable()) @@ -300,16 +300,14 @@ def test_publish(self): # publish_submission ignores the slug parameter) if not project.is_new_version: taken_slug = PublishedProject.objects.all().first().slug - response = self.client.post(reverse( - 'publish_submission', args=(project.slug,)), - data={'slug':taken_slug, 'doi': False, 'make_zip':1}) - self.assertTrue(bool(ActiveProject.objects.filter( - slug=project_slug))) + response = self.client.post(reverse('publish_submission', args=(project.slug,)), + data={'slug': taken_slug, 'doi': False, 'make_zip': 1}) + self.assertTrue(bool(ActiveProject.objects.filter(slug=project_slug))) # Publish with a valid custom slug - response = self.client.post(reverse( - 'publish_submission', args=(project.slug,)), - data={'slug':custom_slug, 'doi': False, 'make_zip':1}) + response = self.client.post(reverse('publish_submission', + args=(project.slug,)), data={ + 'slug': custom_slug, 'doi': False, 'make_zip': 1}) # Run background tasks self.assertTrue(bool(tasks.run_next_task())) @@ -322,7 +320,7 @@ def test_publish(self): version=project.version) # Access the published project's page and its (open) files response = self.client.get(reverse('published_project', - args=(project.slug, project.version))) + args=(project.slug, project.version))) self.assertEqual(response.status_code, 200) response = self.client.get(reverse('serve_published_project_file', args=( project.slug, project.version, 'subject-100/100.atr'))) @@ -333,7 +331,7 @@ def test_publish(self): # Access the submission log as the author self.client.login(username='rgmark', password='Tester11!') response = self.client.get(reverse('published_submission_history', - args=(project.slug, project.version,))) + args=(project.slug, project.version,))) self.assertEqual(response.status_code, 200) # The internal links should now point to published files @@ -382,16 +380,13 @@ def test_publish_with_versions(self): for version in versions[1:]: self.client.login(username=self.AUTHOR, password=self.AUTHOR_PASSWORD) - response = self.client.post( - reverse('new_project_version', args=(self.PROJECT_SLUG,)), - data={'version': version}) + response = self.client.post(reverse('new_project_version', args=(self.PROJECT_SLUG,)), + data={'version': version}) project = ActiveProject.objects.get(title='MIT-BIH Arrhythmia Database') - self.client.post(reverse('project_files',args=(project.slug,)), #gives the url #tuple need , - data= - {'has_copy_right_permission': '0', #put in teh request post - 'has_human_subject_data':'0', 'has_phi':'0' , 'submit_upload_agreement': 'submitbutton'}) #html submission #form fields were submitting too + self.client.post(reverse('project_files', args=(project.slug,)), data={ + 'has_copy_right_permission': '0', 'has_human_subject_data': '0', + 'has_phi': '0', 'submit_upload_agreement': 'submitbutton'}) self.test_publish() - # Sort the list of version numbers sorted_versions = [] diff --git a/physionet-django/project/forms.py b/physionet-django/project/forms.py index aff920a022..3243bb48d4 100644 --- a/physionet-django/project/forms.py +++ b/physionet-django/project/forms.py @@ -1176,17 +1176,22 @@ def __init__(self, *args, **kwargs): "Statements on ethics approval should appear here. " "Your statement will be included in the public project description." ) + + class UploadedAgreementDataForm(forms.ModelForm): class Meta: model = DataUploadAgreement fields = ( 'has_copy_right_permission', 'has_human_subject_data', - 'has_phi' - ) - labels = {'has_copy_right_permission': 'Are you the original creator, or copyright holder, or have permission from the creators and copyright holders to share these files?', - 'has_human_subject_data':'Does this project contain data collected from human subjects?', - 'has_phi':'Do these files contain any personally identifiable information (information that could identify individual human subjects)?'} + 'has_phi') + labels = { + 'has_copy_right_permission': 'Are you the original creator, or copyright holder, or have\ + permission from the creators and copyright holders to share these files?', + 'has_human_subject_data': 'Does this project contain data collected from human subjects?', + 'has_phi': 'Do these files contain any personally identifiable information (information\ + that could identify individual human subjects)?'} + def __init__(self, project, *args, **kwargs): super().__init__(*args, **kwargs) self.project = project diff --git a/physionet-django/project/modelcomponents/activeproject.py b/physionet-django/project/modelcomponents/activeproject.py index 1797d04034..47fed25b6e 100644 --- a/physionet-django/project/modelcomponents/activeproject.py +++ b/physionet-django/project/modelcomponents/activeproject.py @@ -329,12 +329,11 @@ def check_integrity(self): f'Corresponding author {author.user.username} ' 'has not set a corresponding email') - #Data Upload Agreement + # Data Upload Agreement try: DataUploadAgreement.objects.get(project_id=self.id) - except: #DataUseAgreement.ObjectDdoestNotExist: + except DataUploadAgreement.ObjectDdoestNotExist: self.integrity_errors.append('Missing required field: Data Upload Agreement') - # Metadata for attr in ActiveProject.REQUIRED_FIELDS[self.resource_type.id]: diff --git a/physionet-django/project/modelcomponents/submission.py b/physionet-django/project/modelcomponents/submission.py index f85329f188..b27ef68f2c 100644 --- a/physionet-django/project/modelcomponents/submission.py +++ b/physionet-django/project/modelcomponents/submission.py @@ -259,7 +259,7 @@ def quota_manager(self): class DataUploadAgreement(models.Model): """This model is used to store the responses from the data use agreement for the project.""" - RESPONSE_CHOICES_1_and_2= ( + RESPONSE_CHOICES_1_and_2 = ( (0, 'Yes'), (1, 'No'), ) @@ -270,6 +270,6 @@ class DataUploadAgreement(models.Model): ) project = models.OneToOneField('project.ActiveProject', on_delete=models.CASCADE) - has_copy_right_permission = models.PositiveSmallIntegerField(choices = RESPONSE_CHOICES_1_and_2) - has_human_subject_data = models.PositiveSmallIntegerField(choices = RESPONSE_CHOICES_1_and_2) - has_phi = models.PositiveSmallIntegerField(choices = RESPONSE_CHOICES_3) + has_copy_right_permission = models.PositiveSmallIntegerField(choices=RESPONSE_CHOICES_1_and_2) + has_human_subject_data = models.PositiveSmallIntegerField(choices=RESPONSE_CHOICES_1_and_2) + has_phi = models.PositiveSmallIntegerField(choices=RESPONSE_CHOICES_3) diff --git a/physionet-django/project/views.py b/physionet-django/project/views.py index 2ff497c0a1..c5f702c3e6 100644 --- a/physionet-django/project/views.py +++ b/physionet-django/project/views.py @@ -48,7 +48,8 @@ Reference, StorageRequest, Topic, - UploadedDocument,DataUploadAgreement + UploadedDocument, + DataUploadAgreement ) from project.projectfiles import ProjectFiles from project.validators import validate_filename, validate_gcs_bucket_object @@ -1061,7 +1062,7 @@ def project_files(request, project_slug, subdir='', **kwargs): if settings.SYSTEM_MAINTENANCE_NO_UPLOAD: maintenance_message = settings.SYSTEM_MAINTENANCE_MESSAGE or ( "The site is currently undergoing maintenance, and project " - "files cannot be edited. Please try again later." + "files cannot be edited. Please try again later." ) files_editable = False else: From de959830abe3d20cb1a315117990da5c7e591636 Mon Sep 17 00:00:00 2001 From: Dana Date: Wed, 14 Dec 2022 04:19:30 -0500 Subject: [PATCH 12/32] removes the except in dua --- physionet-django/project/modelcomponents/activeproject.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physionet-django/project/modelcomponents/activeproject.py b/physionet-django/project/modelcomponents/activeproject.py index 47fed25b6e..e6953a184e 100644 --- a/physionet-django/project/modelcomponents/activeproject.py +++ b/physionet-django/project/modelcomponents/activeproject.py @@ -332,7 +332,7 @@ def check_integrity(self): # Data Upload Agreement try: DataUploadAgreement.objects.get(project_id=self.id) - except DataUploadAgreement.ObjectDdoestNotExist: + except: self.integrity_errors.append('Missing required field: Data Upload Agreement') # Metadata From 451cbc2cf5cc4422caf60190da1bf6d080f5f938 Mon Sep 17 00:00:00 2001 From: Dana Date: Wed, 14 Dec 2022 12:45:00 -0500 Subject: [PATCH 13/32] fix style checks --- physionet-django/console/test_views.py | 10 ++++------ .../project/migrations/0064_datauploadagreement.py | 3 ++- .../project/modelcomponents/activeproject.py | 2 +- physionet-django/project/views.py | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/physionet-django/console/test_views.py b/physionet-django/console/test_views.py index 33cbb31f0a..82bff6aca3 100644 --- a/physionet-django/console/test_views.py +++ b/physionet-django/console/test_views.py @@ -212,8 +212,8 @@ def test_copyedit(self): # Recomplete copyedit response = self.client.post(reverse( 'copyedit_submission', args=(project.slug,)), - data={'complete_copyedit': '', 'made_changes':1, - 'changelog_summary': 'Removed your things'}) + data={'complete_copyedit': '', 'made_changes': 1, + 'changelog_summary': 'Removed your things'}) project = ActiveProject.objects.get(id=project.id) self.assertFalse(project.copyeditable()) @@ -319,8 +319,7 @@ def test_publish(self): project = PublishedProject.objects.get(slug=custom_slug, version=project.version) # Access the published project's page and its (open) files - response = self.client.get(reverse('published_project', - args=(project.slug, project.version))) + response = self.client.get(reverse('published_project', args=(project.slug, project.version))) self.assertEqual(response.status_code, 200) response = self.client.get(reverse('serve_published_project_file', args=( project.slug, project.version, 'subject-100/100.atr'))) @@ -330,8 +329,7 @@ def test_publish(self): self.assertEqual(response.status_code, 200) # Access the submission log as the author self.client.login(username='rgmark', password='Tester11!') - response = self.client.get(reverse('published_submission_history', - args=(project.slug, project.version,))) + response = self.client.get(reverse('published_submission_history', args=(project.slug, project.version,))) self.assertEqual(response.status_code, 200) # The internal links should now point to published files diff --git a/physionet-django/project/migrations/0064_datauploadagreement.py b/physionet-django/project/migrations/0064_datauploadagreement.py index 3b8eedd1d5..d4698b8cfb 100644 --- a/physionet-django/project/migrations/0064_datauploadagreement.py +++ b/physionet-django/project/migrations/0064_datauploadagreement.py @@ -18,7 +18,8 @@ class Migration(migrations.Migration): ('has_copy_right_permission', models.PositiveSmallIntegerField(choices=[(0, 'Yes'), (1, 'No')])), ('has_human_subject_data', models.PositiveSmallIntegerField(choices=[(0, 'Yes'), (1, 'No')])), ('has_phi', models.PositiveSmallIntegerField(choices=[(0, 'Yes'), (1, 'No'), (2, 'NA')])), - ('project', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='project.activeproject')), + ('project', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, + to='project.activeproject')), ], ), ] diff --git a/physionet-django/project/modelcomponents/activeproject.py b/physionet-django/project/modelcomponents/activeproject.py index e6953a184e..274df30882 100644 --- a/physionet-django/project/modelcomponents/activeproject.py +++ b/physionet-django/project/modelcomponents/activeproject.py @@ -332,7 +332,7 @@ def check_integrity(self): # Data Upload Agreement try: DataUploadAgreement.objects.get(project_id=self.id) - except: + except DataUploadAgreement.IntegrityError: self.integrity_errors.append('Missing required field: Data Upload Agreement') # Metadata diff --git a/physionet-django/project/views.py b/physionet-django/project/views.py index c5f702c3e6..b01f24dfae 100644 --- a/physionet-django/project/views.py +++ b/physionet-django/project/views.py @@ -1063,7 +1063,7 @@ def project_files(request, project_slug, subdir='', **kwargs): maintenance_message = settings.SYSTEM_MAINTENANCE_MESSAGE or ( "The site is currently undergoing maintenance, and project " "files cannot be edited. Please try again later." - ) +) files_editable = False else: maintenance_message = None From c703060a87bdbcb1fa1394a69cc2e0ad84ade7c4 Mon Sep 17 00:00:00 2001 From: Dana Date: Wed, 14 Dec 2022 12:57:59 -0500 Subject: [PATCH 14/32] adds except error explicitly --- physionet-django/project/modelcomponents/activeproject.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physionet-django/project/modelcomponents/activeproject.py b/physionet-django/project/modelcomponents/activeproject.py index 274df30882..3e5c2e00b3 100644 --- a/physionet-django/project/modelcomponents/activeproject.py +++ b/physionet-django/project/modelcomponents/activeproject.py @@ -332,7 +332,7 @@ def check_integrity(self): # Data Upload Agreement try: DataUploadAgreement.objects.get(project_id=self.id) - except DataUploadAgreement.IntegrityError: + except DataUploadAgreement.ObjectDoestNotExist: self.integrity_errors.append('Missing required field: Data Upload Agreement') # Metadata From e705677780c5c09955dfa03afb3dcf1c63674897 Mon Sep 17 00:00:00 2001 From: Dana Date: Wed, 14 Dec 2022 13:29:17 -0500 Subject: [PATCH 15/32] fixes exception error and response variable status --- physionet-django/console/test_views.py | 6 ++++++ physionet-django/project/modelcomponents/activeproject.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/physionet-django/console/test_views.py b/physionet-django/console/test_views.py index 82bff6aca3..f60d9ea2ca 100644 --- a/physionet-django/console/test_views.py +++ b/physionet-django/console/test_views.py @@ -53,10 +53,12 @@ def test_assign_editor(self): response = self.client.post(reverse( 'submitted_projects'), data={'project':project.id, 'editor':editor.id}) + self.assertEqual(response.status_code, 200) project = ActiveProject.objects.get(title='MIT-BIH Arrhythmia Database') self.assertTrue(project.editor, editor) self.assertEqual(project.submission_status, 20) + def test_reassign_editor(self): """ Assign an editor, then reassign it @@ -69,6 +71,7 @@ def test_reassign_editor(self): editor = User.objects.get(username='cindyehlert') response = self.client.post(reverse('submitted_projects'), data={ 'project': project.id, 'editor': editor.id}) + self.assertEqual(response.status_code, 200) project = ActiveProject.objects.get(title='MIT-BIH Arrhythmia Database') self.assertTrue(project.editor, editor) self.assertEqual(project.submission_status, 20) @@ -77,9 +80,11 @@ def test_reassign_editor(self): editor = User.objects.get(username='amitupreti') response = self.client.post(reverse('submission_info', args=(project.slug,)), data={'editor': editor.id}) + self.assertEqual(response.status_code, 200) project = ActiveProject.objects.get(title='MIT-BIH Arrhythmia Database') self.assertTrue(project.editor, editor) + def test_edit_reject(self): """ Edit a project, rejecting it. @@ -386,6 +391,7 @@ def test_publish_with_versions(self): 'has_phi': '0', 'submit_upload_agreement': 'submitbutton'}) self.test_publish() + # Sort the list of version numbers sorted_versions = [] for version in versions: diff --git a/physionet-django/project/modelcomponents/activeproject.py b/physionet-django/project/modelcomponents/activeproject.py index 3e5c2e00b3..0efd97d9ca 100644 --- a/physionet-django/project/modelcomponents/activeproject.py +++ b/physionet-django/project/modelcomponents/activeproject.py @@ -332,7 +332,7 @@ def check_integrity(self): # Data Upload Agreement try: DataUploadAgreement.objects.get(project_id=self.id) - except DataUploadAgreement.ObjectDoestNotExist: + except DataUploadAgreement.DoesNotExist: self.integrity_errors.append('Missing required field: Data Upload Agreement') # Metadata From b1d6155f1d3c3c9c2a2f3e0b0ff329c9a1fffb88 Mon Sep 17 00:00:00 2001 From: Dana Date: Wed, 14 Dec 2022 13:42:15 -0500 Subject: [PATCH 16/32] adds status assertion for another response variable --- physionet-django/console/test_views.py | 1 + 1 file changed, 1 insertion(+) diff --git a/physionet-django/console/test_views.py b/physionet-django/console/test_views.py index f60d9ea2ca..06604ac13e 100644 --- a/physionet-django/console/test_views.py +++ b/physionet-django/console/test_views.py @@ -385,6 +385,7 @@ def test_publish_with_versions(self): password=self.AUTHOR_PASSWORD) response = self.client.post(reverse('new_project_version', args=(self.PROJECT_SLUG,)), data={'version': version}) + self.assertEqual(response.status_code, 200) project = ActiveProject.objects.get(title='MIT-BIH Arrhythmia Database') self.client.post(reverse('project_files', args=(project.slug,)), data={ 'has_copy_right_permission': '0', 'has_human_subject_data': '0', From cba93f9ab4d2ffaa42a5d4d0c4c4fb30f221fd50 Mon Sep 17 00:00:00 2001 From: Dana Date: Wed, 14 Dec 2022 13:59:16 -0500 Subject: [PATCH 17/32] adjusts status code to redirect 302 --- physionet-django/console/test_views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physionet-django/console/test_views.py b/physionet-django/console/test_views.py index 06604ac13e..c674656366 100644 --- a/physionet-django/console/test_views.py +++ b/physionet-django/console/test_views.py @@ -385,7 +385,7 @@ def test_publish_with_versions(self): password=self.AUTHOR_PASSWORD) response = self.client.post(reverse('new_project_version', args=(self.PROJECT_SLUG,)), data={'version': version}) - self.assertEqual(response.status_code, 200) + self.assertEqual(response.status_code, 302) project = ActiveProject.objects.get(title='MIT-BIH Arrhythmia Database') self.client.post(reverse('project_files', args=(project.slug,)), data={ 'has_copy_right_permission': '0', 'has_human_subject_data': '0', From bbad8cafea6526e7a32014f8a5c8b863c60896fc Mon Sep 17 00:00:00 2001 From: Dana Moukheiber Date: Wed, 14 Dec 2022 14:27:17 -0500 Subject: [PATCH 18/32] fix style errors --- physionet-django/project/views.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/physionet-django/project/views.py b/physionet-django/project/views.py index b01f24dfae..0a8cdc18c9 100644 --- a/physionet-django/project/views.py +++ b/physionet-django/project/views.py @@ -1037,13 +1037,13 @@ def project_files(request, project_slug, subdir='', **kwargs): if storage_request: storage_request.get().delete() messages.success(request, 'Your storage request has been cancelled.') - elif 'submit_upload_agreement' in request.POST: + elif 'submit_upload_agreement' in request.POST: try: agreement= DataUploadAgreement.objects.get(project=project) except DataUploadAgreement.DoesNotExist: - agreement = None + agreement = None upload_agreement_form = forms.UploadedAgreementDataForm(project=project, - data=request.POST, instance=agreement) + data=request.POST, instance=agreement) if upload_agreement_form.is_valid(): upload_agreement_form.instance.project = project upload_agreement_form.save() @@ -1062,8 +1062,7 @@ def project_files(request, project_slug, subdir='', **kwargs): if settings.SYSTEM_MAINTENANCE_NO_UPLOAD: maintenance_message = settings.SYSTEM_MAINTENANCE_MESSAGE or ( "The site is currently undergoing maintenance, and project " - "files cannot be edited. Please try again later." -) + "files cannot be edited. Please try again later.") files_editable = False else: maintenance_message = None @@ -1076,7 +1075,7 @@ def project_files(request, project_slug, subdir='', **kwargs): forms.StorageRequestForm(project=project) if (not storage_request and is_submitting) else None ) upload_agreement_form = ( - forms.UploadedAgreementDataForm(project=project) + forms.UploadedAgreementDataForm(project=project) ) (display_files, display_dirs, dir_breadcrumbs, parent_dir, From 50b7916a9622eabd5a727b62f6f48bf9c1a8edec Mon Sep 17 00:00:00 2001 From: Dana Moukheiber Date: Wed, 14 Dec 2022 14:52:03 -0500 Subject: [PATCH 19/32] fixes styling --- physionet-django/project/fixtures/demo-project.json | 2 +- .../project/templates/project/upload_data_agreement.html | 1 - physionet-django/templates/about/files.html | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/physionet-django/project/fixtures/demo-project.json b/physionet-django/project/fixtures/demo-project.json index 10376f8e68..8010f386eb 100644 --- a/physionet-django/project/fixtures/demo-project.json +++ b/physionet-django/project/fixtures/demo-project.json @@ -2257,7 +2257,7 @@ "project": 1, "has_copy_right_permission":0, "has_human_subject_data":0, - "has_phi":1 + "has_phi":1 } } ] diff --git a/physionet-django/project/templates/project/upload_data_agreement.html b/physionet-django/project/templates/project/upload_data_agreement.html index 4d665a966d..b19d9e0088 100644 --- a/physionet-django/project/templates/project/upload_data_agreement.html +++ b/physionet-django/project/templates/project/upload_data_agreement.html @@ -32,4 +32,3 @@
    PhysioNet Data Upload and Sharing Agreement
    - \ No newline at end of file diff --git a/physionet-django/templates/about/files.html b/physionet-django/templates/about/files.html index b559cb1f45..15660fad2e 100644 --- a/physionet-django/templates/about/files.html +++ b/physionet-django/templates/about/files.html @@ -20,4 +20,3 @@
  • Provide a list of all WFDB format records, named RECORDS. Example file. If you upload this file, you will see a link to view your project's waveforms in LightWAVE.
  • Provide a tab delimited list of all WFDB format annotation files, named ANNOTATORS. Example file.
  • - From 6411c2a87e1aade7cd2de878a86fa0327e27dbae Mon Sep 17 00:00:00 2001 From: Lama Date: Wed, 14 Dec 2022 16:22:57 -0500 Subject: [PATCH 20/32] fixes styling --- physionet-django/project/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/physionet-django/project/views.py b/physionet-django/project/views.py index 0a8cdc18c9..e9799072a2 100644 --- a/physionet-django/project/views.py +++ b/physionet-django/project/views.py @@ -1039,11 +1039,11 @@ def project_files(request, project_slug, subdir='', **kwargs): messages.success(request, 'Your storage request has been cancelled.') elif 'submit_upload_agreement' in request.POST: try: - agreement= DataUploadAgreement.objects.get(project=project) + agreement = DataUploadAgreement.objects.get(project=project) except DataUploadAgreement.DoesNotExist: agreement = None upload_agreement_form = forms.UploadedAgreementDataForm(project=project, - data=request.POST, instance=agreement) + data=request.POST, instance=agreement) if upload_agreement_form.is_valid(): upload_agreement_form.instance.project = project upload_agreement_form.save() @@ -1062,7 +1062,7 @@ def project_files(request, project_slug, subdir='', **kwargs): if settings.SYSTEM_MAINTENANCE_NO_UPLOAD: maintenance_message = settings.SYSTEM_MAINTENANCE_MESSAGE or ( "The site is currently undergoing maintenance, and project " - "files cannot be edited. Please try again later.") + "files cannot be edited. Please try again later.") files_editable = False else: maintenance_message = None From b5af640d5a743031634175656c82bf11cb05225f Mon Sep 17 00:00:00 2001 From: Lama Date: Wed, 14 Dec 2022 16:44:57 -0500 Subject: [PATCH 21/32] add the dua agreement icon for submission --- .../project/templates/project/upload_data_agreement.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physionet-django/project/templates/project/upload_data_agreement.html b/physionet-django/project/templates/project/upload_data_agreement.html index b19d9e0088..4f69317452 100644 --- a/physionet-django/project/templates/project/upload_data_agreement.html +++ b/physionet-django/project/templates/project/upload_data_agreement.html @@ -25,7 +25,7 @@
    PhysioNet Data Upload and Sharing Agreement

    By clicking “I agree” and uploading files to PhysioNet, you agree that the above information is accurate.

    From 5e3e8eb0c85088676f6ed4bee5a922698ea2c2f8 Mon Sep 17 00:00:00 2001 From: Lama Date: Wed, 14 Dec 2022 17:01:54 -0500 Subject: [PATCH 22/32] updates the data upload agreement text in project files --- .../project/templates/project/upload_data_agreement.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physionet-django/project/templates/project/upload_data_agreement.html b/physionet-django/project/templates/project/upload_data_agreement.html index 4f69317452..730902be37 100644 --- a/physionet-django/project/templates/project/upload_data_agreement.html +++ b/physionet-django/project/templates/project/upload_data_agreement.html @@ -1,8 +1,8 @@ PhysioNet Data Upload and Sharing Agreement
      -
    • Please fill in the project agreement form. +
    • Please complete the project data upload agreement form below before uploading the project files.
    • -
      +
    From 8133f651b33ed679d5df9d576f80baf3c420388a Mon Sep 17 00:00:00 2001 From: lamam Date: Thu, 16 Mar 2023 14:28:35 -0400 Subject: [PATCH 23/32] update the migration file --- ...{0064_datauploadagreement.py => 0068_datauploadagreement.py} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename physionet-django/project/migrations/{0064_datauploadagreement.py => 0068_datauploadagreement.py} (93%) diff --git a/physionet-django/project/migrations/0064_datauploadagreement.py b/physionet-django/project/migrations/0068_datauploadagreement.py similarity index 93% rename from physionet-django/project/migrations/0064_datauploadagreement.py rename to physionet-django/project/migrations/0068_datauploadagreement.py index d4698b8cfb..a4e23f1752 100644 --- a/physionet-django/project/migrations/0064_datauploadagreement.py +++ b/physionet-django/project/migrations/0068_datauploadagreement.py @@ -7,7 +7,7 @@ class Migration(migrations.Migration): dependencies = [ - ('project', '0063_auto_20220528_2248'), + ('project', '0067_alter_activeproject_core_project_and_more'), ] operations = [ From ddecae0e5803af5be892712f55a5796747487bfc Mon Sep 17 00:00:00 2001 From: lamam Date: Thu, 23 Mar 2023 14:32:56 -0400 Subject: [PATCH 24/32] adds a boostrap to the agreement form --- .../templates/project/upload_data_agreement.html | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/physionet-django/project/templates/project/upload_data_agreement.html b/physionet-django/project/templates/project/upload_data_agreement.html index 730902be37..d2f15f9b72 100644 --- a/physionet-django/project/templates/project/upload_data_agreement.html +++ b/physionet-django/project/templates/project/upload_data_agreement.html @@ -1,8 +1,13 @@ PhysioNet Data Upload and Sharing Agreement -
      -
    • Please complete the project data upload agreement form below before uploading the project files. -
    • -
    +{% if not project.datauploadagreement %} +
    + Please complete the project data upload agreement form below before uploading the project files. +
    + {% else %} +
    + Please don't include any Personal Health Information within your uploaded project files. +
    +{% endif %} From 8ff421184fcd79a06b8cfd6f9198023665b7c77c Mon Sep 17 00:00:00 2001 From: lamam Date: Thu, 23 Mar 2023 14:33:34 -0400 Subject: [PATCH 25/32] populates the form after submission --- physionet-django/project/views.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/physionet-django/project/views.py b/physionet-django/project/views.py index e9799072a2..79cb4e4d57 100644 --- a/physionet-django/project/views.py +++ b/physionet-django/project/views.py @@ -1074,9 +1074,11 @@ def project_files(request, project_slug, subdir='', **kwargs): storage_request_form = ( forms.StorageRequestForm(project=project) if (not storage_request and is_submitting) else None ) - upload_agreement_form = ( - forms.UploadedAgreementDataForm(project=project) - ) + try: + agreement = DataUploadAgreement.objects.get(project=project) + except DataUploadAgreement.DoesNotExist: + agreement = None + upload_agreement_form = forms.UploadedAgreementDataForm(project=project, instance=agreement) (display_files, display_dirs, dir_breadcrumbs, parent_dir, file_error) = get_project_file_info(project=project, subdir=subdir) From 852148dfa294f169d0bd014c1b847cd6b940b440 Mon Sep 17 00:00:00 2001 From: lamam Date: Thu, 23 Mar 2023 14:49:15 -0400 Subject: [PATCH 26/32] updates the html to include site name --- .../project/templates/project/upload_data_agreement.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/physionet-django/project/templates/project/upload_data_agreement.html b/physionet-django/project/templates/project/upload_data_agreement.html index d2f15f9b72..ba7592ab34 100644 --- a/physionet-django/project/templates/project/upload_data_agreement.html +++ b/physionet-django/project/templates/project/upload_data_agreement.html @@ -1,4 +1,4 @@ -PhysioNet Data Upload and Sharing Agreement +

    Data Upload and Sharing Agreement

    {% if not project.datauploadagreement %}
    Please complete the project data upload agreement form below before uploading the project files. @@ -24,10 +24,9 @@