From 9373ba6ff5b0a0b3e255f1e689133ff087afcef0 Mon Sep 17 00:00:00 2001 From: Ryan Barrett Date: Mon, 31 Mar 2014 19:14:23 -0700 Subject: [PATCH] fix cache gating in G+ and Twitter get_activities() --- googleplus.py | 2 +- twitter.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/googleplus.py b/googleplus.py index 6a017198..2f126811 100644 --- a/googleplus.py +++ b/googleplus.py @@ -133,7 +133,7 @@ def request_with_etag(*args, **kwargs): response = self._make_activities_base_response(activities) response['etag'] = etag - if cache_updates: + if cache_updates and cache is not None: cache.set_multi(cache_updates) return response diff --git a/twitter.py b/twitter.py index e9eab17e..d05aca48 100644 --- a/twitter.py +++ b/twitter.py @@ -225,7 +225,7 @@ def get_activities_response(self, user_id=None, group_id=None, app_id=None, response = self._make_activities_base_response(activities) response.update({'total_count': total_count, 'etag': etag}) - if cache is not None: + if cache_updates and cache is not None: cache.set_multi(cache_updates) return response