chore(profile): reformat, fix mypy bug

Ref. 16f503edb8
This commit is contained in:
Ethan Nguyen 2021-04-22 22:43:27 -04:00
parent 16f503edb8
commit 21df376be4
No known key found for this signature in database
GPG Key ID: B4CA5339AF911920
2 changed files with 14 additions and 4 deletions

View File

@ -73,9 +73,14 @@ class DecisionForm(forms.ModelForm):
raise ValidationError("You cannot add a second entry for this college") raise ValidationError("You cannot add a second entry for this college")
# Rolling and RD decisions cannot be deferred # Rolling and RD decisions cannot be deferred
if cleaned_data.get("decision_type") in [Decision.REGULAR_DECISION, Decision.ROLLING]: if cleaned_data.get("decision_type") in [
if "DEFER" in cleaned_data.get("admission_status"): Decision.REGULAR_DECISION,
raise ValidationError("Regular Decision and Rolling decisions cannot result in a deferral") 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 return cleaned_data

View File

@ -448,7 +448,12 @@ class ProfileTest(TJDestsTestCase):
}, },
) )
self.assertEqual(302, response.status_code) 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): def test_decision_update(self):
user = self.login(make_senior=True, make_student=True, accept_tos=True) user = self.login(make_senior=True, make_student=True, accept_tos=True)