diff --git a/spaceapi/utils.py b/spaceapi/utils.py --- a/spaceapi/utils.py +++ b/spaceapi/utils.py @@ -98,14 +98,14 @@ class ActiveStatus(Singleton, dict): if value is not None: self['state']['open'] = value - if 'twitter_consumer_key' in current_app.config: + if 'TWITTER_CONSUMER_KEY' in current_app.config: auth = tweepy.OAuthHandler( - current_app.config['twitter_consumer_key'], - current_app.config['twitter_consumer_secret'] + current_app.config['TWITTER_CONSUMER_KEY'], + current_app.config['TWITTER_CONSUMER_SECRET'] ) auth.set_access_token( - current_app.config['twitter_access_token_key'], - current_app.config['twitter.access_token_secret'] + current_app.config['TWITTER_ACCESS_TOKEN_KEY'], + current_app.config['TWITTER_ACCESS_TOKEN_SECRET'] ) api = tweepy.API(auth) @@ -116,9 +116,9 @@ class ActiveStatus(Singleton, dict): if not value: if 'people_now_present' in self['sensors']: - self['sensors']['people_now_present']['value'] = 0 - if 'names' in self['sensors']['people_now_present']: - del self['sensors']['people_now_present']['names'] + self['sensors']['people_now_present'][0]['value'] = 0 + if 'names' in self['sensors']['people_now_present'][0]: + del self['sensors']['people_now_present'][0]['names'] if 'message' in self['state']: del self['state']['message']