From e6945a62c17a18734bd978df53fd8cae36554e06 Mon Sep 17 00:00:00 2001 From: Justin Zhang Date: Tue, 12 Sep 2023 12:35:31 -0400 Subject: [PATCH] Update python syntax --- backend/gsr_booking/models.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/backend/gsr_booking/models.py b/backend/gsr_booking/models.py index c82f9854..fe36fec9 100644 --- a/backend/gsr_booking/models.py +++ b/backend/gsr_booking/models.py @@ -56,12 +56,7 @@ def check_wharton(self): return None res_json = response.json() - if "type" in res_json: - # check if user is wharton - return res_json["type"] == "whartonMBA" or res_json["type"] == "whartonUGR" - else: - # accomodate for inconsistent responses - return False + return res_json.get("type") == "whartonMBA" or res_json.get("type") == "whartonUGR" except (ConnectTimeout, ReadTimeout, KeyError, ConnectionError): return None