From 2a355496312a6dc3a7ec73fff0fb84429a8a7796 Mon Sep 17 00:00:00 2001 From: Shaily Date: Jan 25 2018 08:19:59 +0000 Subject: Address private fields in FAS --- diff --git a/hubs/static/client/app/components/UserContact.js b/hubs/static/client/app/components/UserContact.js index 471d7e4..b1859ef 100644 --- a/hubs/static/client/app/components/UserContact.js +++ b/hubs/static/client/app/components/UserContact.js @@ -12,41 +12,51 @@ export default class UserContact extends React.Component { return (
-
- - + { this.props.hub.config.creation_date && +
+ + Member Since - -
+
+ }
); } diff --git a/hubs/utils/fas.py b/hubs/utils/fas.py index a992ebf..6805eb6 100644 --- a/hubs/utils/fas.py +++ b/hubs/utils/fas.py @@ -120,13 +120,14 @@ class FASClient(object): if fas_user[fas_attr] is None: continue hub.config[hub_attr] = fas_user[fas_attr] - country = pycountry.countries.get(alpha_2=fas_user["country_code"]) - hub.config["country"] = country.name - # Timezone - now = datetime.datetime.now() # does not really matter, legacy API - tz_offset = timezone(fas_user["timezone"]).utcoffset(now) - hub.config["timezone_offset"] = ( - tz_offset.days * 86400 + tz_offset.seconds) + if fas_user["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: + now = datetime.datetime.now() # does not really matter, legacy API + tz_offset = timezone(fas_user["timezone"]).utcoffset(now) + hub.config["timezone_offset"] = ( + tz_offset.days * 86400 + tz_offset.seconds) return fas_user def sync_user_roles(self, user, hub=None):