From 21df376be4816d7cc9c010754396c802ab4cf604 Mon Sep 17 00:00:00 2001 From: Ethan Nguyen Date: Thu, 22 Apr 2021 22:43:27 -0400 Subject: [PATCH] chore(profile): reformat, fix mypy bug Ref. 16f503edb8dfee67d0cd2580bf93ad65d19df835 --- tjdests/apps/profile/forms.py | 11 ++++++++--- tjdests/apps/profile/tests.py | 7 ++++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/tjdests/apps/profile/forms.py b/tjdests/apps/profile/forms.py index 12eb9c3..4b5a9ec 100644 --- a/tjdests/apps/profile/forms.py +++ b/tjdests/apps/profile/forms.py @@ -73,9 +73,14 @@ class DecisionForm(forms.ModelForm): raise ValidationError("You cannot add a second entry for this college") # Rolling and RD decisions cannot be deferred - if cleaned_data.get("decision_type") in [Decision.REGULAR_DECISION, Decision.ROLLING]: - if "DEFER" in cleaned_data.get("admission_status"): - raise ValidationError("Regular Decision and Rolling decisions cannot result in a deferral") + if cleaned_data.get("decision_type") in [ + Decision.REGULAR_DECISION, + Decision.ROLLING, + ]: + if "DEFER" in cleaned_data.get("admission_status", ""): + raise ValidationError( + "Regular Decision and Rolling decisions cannot result in a deferral" + ) return cleaned_data diff --git a/tjdests/apps/profile/tests.py b/tjdests/apps/profile/tests.py index fde12df..32c7f60 100644 --- a/tjdests/apps/profile/tests.py +++ b/tjdests/apps/profile/tests.py @@ -448,7 +448,12 @@ class ProfileTest(TJDestsTestCase): }, ) self.assertEqual(302, response.status_code) - self.assertEqual(1, Decision.objects.filter(college=college, user=user, admission_status=Decision.WAITLIST).count()) + self.assertEqual( + 1, + Decision.objects.filter( + college=college, user=user, admission_status=Decision.WAITLIST + ).count(), + ) def test_decision_update(self): user = self.login(make_senior=True, make_student=True, accept_tos=True)