From 462574c0e843a7f91ae4ce7d46422d9652a4fd9f Mon Sep 17 00:00:00 2001 From: Florent Yvon Date: Fri, 19 Apr 2024 15:32:12 +0100 Subject: [PATCH 1/4] Setting proper embargoed curation status if 'E' import --- curation/imports/curation.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/curation/imports/curation.py b/curation/imports/curation.py index ab662ded..36f03519 100644 --- a/curation/imports/curation.py +++ b/curation/imports/curation.py @@ -150,7 +150,10 @@ def run_curation_import(self): self.failed_studies[study_import.study_name] = 'curation tracker error' if curation_pub != None: - curation_pub.curation_status = 'Imported - Awaiting Release' + if study_import.study_publication.curation_status == 'E': + curation_pub.curation_status = 'Embargo Imported - Awaiting Release' + else: + curation_pub.curation_status = 'Imported - Awaiting Release' curation_pub.save() print(" > Curation status updated in the Curation Tracker") From a496c5ced5d5c9949701d4808ca3b453e3c97cd3 Mon Sep 17 00:00:00 2001 From: Florent Yvon Date: Fri, 19 Apr 2024 16:03:20 +0100 Subject: [PATCH 2/4] Renamed status 'Awaiting Release' to 'Awaiting Publication' for embargoes --- curation/imports/curation.py | 2 +- curation_tracker/admin.py | 4 ++-- ...ionpublicationannotation_curation_status.py | 18 ++++++++++++++++++ curation_tracker/models.py | 2 +- release/scripts/run_release_script.py | 2 +- 5 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 curation_tracker/migrations/0005_alter_curationpublicationannotation_curation_status.py diff --git a/curation/imports/curation.py b/curation/imports/curation.py index 36f03519..3d743187 100644 --- a/curation/imports/curation.py +++ b/curation/imports/curation.py @@ -151,7 +151,7 @@ def run_curation_import(self): if curation_pub != None: if study_import.study_publication.curation_status == 'E': - curation_pub.curation_status = 'Embargo Imported - Awaiting Release' + curation_pub.curation_status = 'Embargo Imported - Awaiting Publication' else: curation_pub.curation_status = 'Imported - Awaiting Release' curation_pub.save() diff --git a/curation_tracker/admin.py b/curation_tracker/admin.py index 4803da1e..3e52924c 100644 --- a/curation_tracker/admin.py +++ b/curation_tracker/admin.py @@ -448,7 +448,7 @@ def save_model(self, request, obj, form, change): # Desembargo the study if obj.embargoed == False and (not db_obj or db_obj.embargoed == True): - if obj.curation_status == 'Embargo Imported - Awaiting Release': + if obj.curation_status == 'Embargo Imported - Awaiting Publication': if obj.doi or obj.PMID: obj.curation_status = 'Imported - Awaiting Release' elif obj.curation_status == 'Embargo Curated - Awaiting Import': @@ -465,7 +465,7 @@ def save_model(self, request, obj, form, change): if obj.curation_status == 'Curated - Awaiting Import': obj.curation_status = 'Embargo Curated - Awaiting Import' elif obj.curation_status == 'Imported - Awaiting Release': - obj.curation_status == 'Embargo Imported - Awaiting Release' + obj.curation_status = 'Embargo Imported - Awaiting Publication' # Eligibility - part 2 if obj.curation_status == 'Abandoned/Ineligible': diff --git a/curation_tracker/migrations/0005_alter_curationpublicationannotation_curation_status.py b/curation_tracker/migrations/0005_alter_curationpublicationannotation_curation_status.py new file mode 100644 index 00000000..38e0c181 --- /dev/null +++ b/curation_tracker/migrations/0005_alter_curationpublicationannotation_curation_status.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.10 on 2024-04-19 14:51 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('curation_tracker', '0004_emailtemplate'), + ] + + operations = [ + migrations.AlterField( + model_name='curationpublicationannotation', + name='curation_status', + field=models.CharField(blank=True, choices=[('Abandoned/Ineligible', 'Abandoned/Ineligible'), ('Pending author response', 'Pending author response'), ('Awaiting L1', 'Awaiting L1'), ('Awaiting L2', 'Awaiting L2'), ('Curated - Awaiting Import', 'Curated - Awaiting Import'), ('Imported - Awaiting Release', 'Imported - Awaiting Release'), ('Released', 'Released'), ('Embargo Curated - Awaiting Import', 'Embargo Curated - Awaiting Import'), ('Embargo Imported - Awaiting Publication', 'Embargo Imported - Awaiting Publication'), ('Embargo Lifted - Awaiting Release', 'Embargo Lifted - Awaiting Release'), ('Retired', 'Retired')], default='Awaiting L1', max_length=50, null=True, verbose_name='Curation Status'), + ), + ] diff --git a/curation_tracker/models.py b/curation_tracker/models.py index a3c6dfc0..ece0215c 100644 --- a/curation_tracker/models.py +++ b/curation_tracker/models.py @@ -83,7 +83,7 @@ class CurationPublicationAnnotation(models.Model): ('Imported - Awaiting Release','Imported - Awaiting Release'), ('Released','Released'), ('Embargo Curated - Awaiting Import','Embargo Curated - Awaiting Import'), - ('Embargo Imported - Awaiting Release','Embargo Imported - Awaiting Release'), + ('Embargo Imported - Awaiting Publication','Embargo Imported - Awaiting Publication'), ('Embargo Lifted - Awaiting Release','Embargo Lifted - Awaiting Release'), ('Retired','Retired') ] diff --git a/release/scripts/run_release_script.py b/release/scripts/run_release_script.py index 338bb393..4b11a7f2 100644 --- a/release/scripts/run_release_script.py +++ b/release/scripts/run_release_script.py @@ -205,7 +205,7 @@ def update_curation_tracker(): curation_pub.pgp_id = pgp_id print(' - Updating curation_status on the Curation Tracker') if publication.curation_status == 'E': - curation_pub.curation_status = 'Embargo Imported - Awaiting Release' + curation_pub.curation_status = 'Embargo Imported - Awaiting Publication' else: curation_pub.curation_status = 'Released' curation_pub.release_date = new_release_date From 0970709fcc8a305475ecafa61b84ce1a69c35fb1 Mon Sep 17 00:00:00 2001 From: Florent Yvon Date: Fri, 19 Apr 2024 16:27:14 +0100 Subject: [PATCH 3/4] Adding PGP id to curation publication --- curation/imports/curation.py | 1 + 1 file changed, 1 insertion(+) diff --git a/curation/imports/curation.py b/curation/imports/curation.py index 3d743187..10fd3fb6 100644 --- a/curation/imports/curation.py +++ b/curation/imports/curation.py @@ -150,6 +150,7 @@ def run_curation_import(self): self.failed_studies[study_import.study_name] = 'curation tracker error' if curation_pub != None: + curation_pub.pgp_id = study_import.study_publication.id if study_import.study_publication.curation_status == 'E': curation_pub.curation_status = 'Embargo Imported - Awaiting Publication' else: From 16a625ce34d59e33bb3ad12fa2d4d13ce150a0bb Mon Sep 17 00:00:00 2001 From: Florent Yvon Date: Fri, 19 Apr 2024 17:07:44 +0100 Subject: [PATCH 4/4] Showing lifted embargoes in release-ready table --- curation_tracker/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/curation_tracker/views.py b/curation_tracker/views.py index 08805f34..90137645 100644 --- a/curation_tracker/views.py +++ b/curation_tracker/views.py @@ -37,10 +37,10 @@ def browse_release_ready(request): import_ready = CurationPublicationAnnotation.objects.using(curation_tracker).filter(curation_status='Curated - Awaiting Import') context['table_to_import'] = Browse_CurationPublicationAnnotationReleaseReady(import_ready) - release_ready_count = CurationPublicationAnnotation.objects.using(curation_tracker).filter(curation_status='Imported - Awaiting Release').count() + release_ready_count = CurationPublicationAnnotation.objects.using(curation_tracker).filter(curation_status__in=('Imported - Awaiting Release', 'Embargo Lifted - Awaiting Release')).count() context['studies_to_release_count'] = release_ready_count if release_ready_count: - release_ready = CurationPublicationAnnotation.objects.using(curation_tracker).filter(curation_status='Imported - Awaiting Release') + release_ready = CurationPublicationAnnotation.objects.using(curation_tracker).filter(curation_status__in=('Imported - Awaiting Release', 'Embargo Lifted - Awaiting Release')) context['table_to_release'] = Browse_CurationPublicationAnnotationReleaseReady(release_ready) if context: