diff --git a/dataworkspace/dataworkspace/apps/datasets/models.py b/dataworkspace/dataworkspace/apps/datasets/models.py index 6a8376237d..7b20819395 100644 --- a/dataworkspace/dataworkspace/apps/datasets/models.py +++ b/dataworkspace/dataworkspace/apps/datasets/models.py @@ -898,8 +898,7 @@ def get_pipeline_last_success_date(self): return get_pipeline_last_success_date(pipeline_name) def pipeline_last_run_success(self): - last_state = self.get_pipeline_last_run_state() - return last_state == "success" if last_state is not None else None + return self.get_pipeline_last_run_state() in ["success", None] class SourceTableFieldDefinition(models.Model): diff --git a/dataworkspace/dataworkspace/apps/datasets/views.py b/dataworkspace/dataworkspace/apps/datasets/views.py index c11a371352..db92137232 100644 --- a/dataworkspace/dataworkspace/apps/datasets/views.py +++ b/dataworkspace/dataworkspace/apps/datasets/views.py @@ -483,7 +483,7 @@ def _get_context_data_for_master_dataset(self, ctx, **kwargs): and subscription.first().is_active(), "details": subscription.first(), }, - "all_pipeline_last_runs_succeeded": all( + "show_pipeline_failed_message": not all( (x.pipeline_last_run_succeeded for x in master_datasets_info) ), } diff --git a/dataworkspace/dataworkspace/tests/datasets/test_views.py b/dataworkspace/dataworkspace/tests/datasets/test_views.py index 256ba70c3f..7b03e153c5 100644 --- a/dataworkspace/dataworkspace/tests/datasets/test_views.py +++ b/dataworkspace/dataworkspace/tests/datasets/test_views.py @@ -5024,7 +5024,7 @@ def test_master_dataset_detail_page_shows_pipeline_failures(client, metadata_db) url = reverse("datasets:dataset_detail", args=(dataset.id,)) response = client.get(url) assert response.status_code == 200 - assert not response.context["all_pipeline_last_runs_succeeded"] + assert response.context["show_pipeline_failed_message"] assert ( len( [