diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/migrations/0001_initial.py b/SAS/TMSS/backend/src/tmss/tmssapp/migrations/0001_initial.py index 76d0dc7f0e8530426a173229f714c0a77ff3357a..74dd30b92b0fee17ba8e8d228c5a9ed37563d5d4 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/migrations/0001_initial.py +++ b/SAS/TMSS/backend/src/tmss/tmssapp/migrations/0001_initial.py @@ -641,7 +641,6 @@ class Migration(migrations.Migration): ('ingest_permission_required', models.BooleanField(default=False, help_text='Explicit permission is needed before the task.')), ('ingest_permission_granted_since', models.DateTimeField(help_text='The moment when ingest permission was granted.', null=True)), ('output_pinned', models.BooleanField(default=False, help_text='boolean (default FALSE), which blocks deleting unpinned dataproducts. When toggled ON, backend must pick SUB up for deletion. It also must when dataproducts are unpinned.')), - ('results_accepted', models.BooleanField(default=False, help_text='boolean (default NULL), which records whether the results were accepted, allowing the higher-level accounting to be adjusted.')), ('piggyback_allowed_tbb', models.BooleanField(help_text='Piggyback key for TBB.', null=True)), ('piggyback_allowed_aartfaac', models.BooleanField(help_text='Piggyback key for AARTFAAC.', null=True)), ('priority_rank', models.FloatField(default=0.0, help_text='Priority of this scheduling unit w.r.t. other scheduling units within the same queue and project.')), diff --git a/SAS/TMSS/backend/src/tmss/tmssapp/models/specification.py b/SAS/TMSS/backend/src/tmss/tmssapp/models/specification.py index a1d3aac80ab38076736ee66f443c4b3b053d2af7..9e566cf014efeb6139c502bff3d01f2412564da7 100644 --- a/SAS/TMSS/backend/src/tmss/tmssapp/models/specification.py +++ b/SAS/TMSS/backend/src/tmss/tmssapp/models/specification.py @@ -506,7 +506,6 @@ class SchedulingUnitBlueprint(ProjectPropertyMixin, TemplateSchemaMixin, NamedCo requirements_template = ForeignKey('SchedulingUnitTemplate', on_delete=CASCADE, help_text='Schema used for requirements_doc (IMMUTABLE).') draft = ForeignKey('SchedulingUnitDraft', related_name='scheduling_unit_blueprints', on_delete=PROTECT, help_text='Scheduling Unit Draft which this run instantiates.') output_pinned = BooleanField(default=False, help_text='boolean (default FALSE), which blocks deleting unpinned dataproducts. When toggled ON, backend must pick SUB up for deletion. It also must when dataproducts are unpinned.') - results_accepted = BooleanField(default=False, help_text='boolean (default NULL), which records whether the results were accepted, allowing the higher-level accounting to be adjusted.') piggyback_allowed_tbb = BooleanField(help_text='Piggyback key for TBB.', null=True) piggyback_allowed_aartfaac = BooleanField(help_text='Piggyback key for AARTFAAC.', null=True) priority_rank = FloatField(null=False, default=0.0, help_text='Priority of this scheduling unit w.r.t. other scheduling units within the same queue and project.') diff --git a/SAS/TMSS/backend/src/tmss/workflowapp/flows/schedulingunitflow.py b/SAS/TMSS/backend/src/tmss/workflowapp/flows/schedulingunitflow.py index 437d82c871b96c9492828f6505b13eba8d4f70ad..7f442a0d87c28951694bf440fc4e30b1703fc96b 100644 --- a/SAS/TMSS/backend/src/tmss/workflowapp/flows/schedulingunitflow.py +++ b/SAS/TMSS/backend/src/tmss/workflowapp/flows/schedulingunitflow.py @@ -243,7 +243,7 @@ class SchedulingUnitFlow(Flow): def do_mark_sub(self, activation): activation.process.su.output_pinned = True - activation.process.su.results_accepted = ((activation.process.qa_reporting_to is not None and activation.process.qa_reporting_to.operator_accept) + activation.process.results_accepted = ((activation.process.qa_reporting_to is not None and activation.process.qa_reporting_to.operator_accept) and (activation.process.qa_reporting_sos is not None and activation.process.qa_reporting_sos.sos_accept_show_pi) and (activation.process.decide_acceptance is not None and activation.process.decide_acceptance.sos_accept_after_pi)) diff --git a/SAS/TMSS/backend/src/tmss/workflowapp/migrations/0001_initial.py b/SAS/TMSS/backend/src/tmss/workflowapp/migrations/0001_initial.py index 5a34111ac5ff48565f38e730030b2f1013ee648f..f098ce22a84eed63822235d1627f98f8208c1835 100644 --- a/SAS/TMSS/backend/src/tmss/workflowapp/migrations/0001_initial.py +++ b/SAS/TMSS/backend/src/tmss/workflowapp/migrations/0001_initial.py @@ -62,6 +62,7 @@ class Migration(migrations.Migration): ('qa_reporting_sos', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='workflowapp.QAReportingSOS')), ('qa_reporting_to', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='workflowapp.QAReportingTO')), ('su', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='tmssapp.SchedulingUnitBlueprint')), + ('results_accepted', models.BooleanField(default=None, null=True)) ], options={ 'abstract': False, diff --git a/SAS/TMSS/backend/src/tmss/workflowapp/models/schedulingunitflow.py b/SAS/TMSS/backend/src/tmss/workflowapp/models/schedulingunitflow.py index 3a3c4c6d63779bf1dd9c19cadea5fb62521b48e7..555be3c66f9f0193613be0459635efa1610cd018 100644 --- a/SAS/TMSS/backend/src/tmss/workflowapp/models/schedulingunitflow.py +++ b/SAS/TMSS/backend/src/tmss/workflowapp/models/schedulingunitflow.py @@ -32,8 +32,8 @@ class UnpinData(Model): class SchedulingUnitProcess(Process): su = ForeignKey(SchedulingUnitBlueprint, blank=True, null=True, on_delete=CASCADE) - qa_reporting_to=ForeignKey(QAReportingTO, blank=True, null=True, on_delete=CASCADE) - qa_reporting_sos=ForeignKey(QAReportingSOS, blank=True, null=True, on_delete=CASCADE) - pi_verification=ForeignKey(PIVerification, blank=True, null=True, on_delete=CASCADE) - decide_acceptance=ForeignKey(DecideAcceptance, blank=True, null=True, on_delete=CASCADE) - + qa_reporting_to = ForeignKey(QAReportingTO, blank=True, null=True, on_delete=CASCADE) + qa_reporting_sos = ForeignKey(QAReportingSOS, blank=True, null=True, on_delete=CASCADE) + pi_verification = ForeignKey(PIVerification, blank=True, null=True, on_delete=CASCADE) + decide_acceptance = ForeignKey(DecideAcceptance, blank=True, null=True, on_delete=CASCADE) + results_accepted = BooleanField(default=None, null=True) diff --git a/SAS/TMSS/backend/test/t_tmssapp_specification_django_API.py b/SAS/TMSS/backend/test/t_tmssapp_specification_django_API.py index b06e29792d44d66480cb033d9db0da6e77cea201..a3d0c15d4dcce292467a5ae4bb71a4ed6f6e5a68 100755 --- a/SAS/TMSS/backend/test/t_tmssapp_specification_django_API.py +++ b/SAS/TMSS/backend/test/t_tmssapp_specification_django_API.py @@ -782,7 +782,7 @@ class SchedulingUnitBlueprintTest(unittest.TestCase): scheduling_unit_blueprint.refresh_from_db() # we should be able to modify other fields - scheduling_unit_blueprint.results_accepted = not scheduling_unit_blueprint.results_accepted + scheduling_unit_blueprint.output_pinned = not scheduling_unit_blueprint.output_pinned scheduling_unit_blueprint.save() # but scheduling constraints should be immutable @@ -825,7 +825,7 @@ class SchedulingUnitBlueprintTest(unittest.TestCase): scheduling_unit_blueprint.refresh_from_db() # we should be able to modify other fields - scheduling_unit_blueprint.results_accepted = not scheduling_unit_blueprint.results_accepted + scheduling_unit_blueprint.output_pinned = not scheduling_unit_blueprint.output_pinned scheduling_unit_blueprint.save() # but scheduling constraints should be immutable