From 7ff2b5cc7ac0db85092c9f9307e9f5e4147b5420 Mon Sep 17 00:00:00 2001 From: Tif Tran Date: Mon, 6 May 2019 11:51:10 -0700 Subject: [PATCH] moved review advisory back to required #1238 (#1239) --- app/experimenter/experiments/forms.py | 4 ++-- app/experimenter/experiments/models.py | 7 ++++++- app/experimenter/experiments/tests/test_forms.py | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/app/experimenter/experiments/forms.py b/app/experimenter/experiments/forms.py index 7950095a9e..a75c09d18d 100644 --- a/app/experimenter/experiments/forms.py +++ b/app/experimenter/experiments/forms.py @@ -854,8 +854,8 @@ class ExperimentReviewForm( # Optional review_advisory = forms.BooleanField( required=False, - label="Lightning Advisory", - help_text=Experiment.REVIEW_ADVISORY_HELP_TEXT, + label="Lightning Advisory (Optional)", + help_text=Experiment.REVIEW_GENERAL_HELP_TEXT, ) review_legal = forms.BooleanField( required=False, diff --git a/app/experimenter/experiments/models.py b/app/experimenter/experiments/models.py index 40fcdbf844..68cadb9e7f 100644 --- a/app/experimenter/experiments/models.py +++ b/app/experimenter/experiments/models.py @@ -547,6 +547,7 @@ def _conditional_required_reviews_mapping(self): def _default_required_reviews(self): return [ "review_science", + "review_advisory", "review_engineering", "review_qa_requested", "review_intent_to_ship", @@ -564,7 +565,11 @@ def get_all_required_reviews(self): @property def completed_required_reviews(self): - return all([getattr(self, r) for r in self.get_all_required_reviews()]) + required_reviews = self.get_all_required_reviews() + + # review advisory is an exception that is not required + required_reviews.remove("review_advisory") + return all([getattr(self, r) for r in required_reviews]) @property def completed_all_sections(self): diff --git a/app/experimenter/experiments/tests/test_forms.py b/app/experimenter/experiments/tests/test_forms.py index 12fb87b461..0ad535605f 100644 --- a/app/experimenter/experiments/tests/test_forms.py +++ b/app/experimenter/experiments/tests/test_forms.py @@ -1276,6 +1276,7 @@ def test_required_reviews(self): form.required_reviews, [ form["review_science"], + form["review_advisory"], form["review_engineering"], form["review_qa_requested"], form["review_intent_to_ship"], @@ -1314,7 +1315,6 @@ def test_optional_reviews(self): self.assertEqual( form.optional_reviews, [ - form["review_advisory"], form["review_comms"], form["review_data_steward"], form["review_impacted_teams"],