From 2d8ca5c97c8f1cc0673f1027f45fc65c4efac5c8 Mon Sep 17 00:00:00 2001 From: Shaily Date: Jan 25 2018 08:19:59 +0000 Subject: FAS private fields: Changes from review --- diff --git a/hubs/utils/fas.py b/hubs/utils/fas.py index 6805eb6..98b782b 100644 --- a/hubs/utils/fas.py +++ b/hubs/utils/fas.py @@ -120,10 +120,10 @@ class FASClient(object): if fas_user[fas_attr] is None: continue hub.config[hub_attr] = fas_user[fas_attr] - if fas_user["country_code"] is not None: + if fas_user.get("country_code") is not None: country = pycountry.countries.get(alpha_2=fas_user["country_code"]) hub.config["country"] = country.name - if fas_user["timezone"] is not None: + if fas_user.get("timezone") is not None: now = datetime.datetime.now() # does not really matter, legacy API tz_offset = timezone(fas_user["timezone"]).utcoffset(now) hub.config["timezone_offset"] = (