Skip to content

Commit

Permalink
Update python syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
judtinzhang committed Sep 12, 2023
1 parent e5a0341 commit e6945a6
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions backend/gsr_booking/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e6945a6

Please sign in to comment.