From aa05ac0718fca600a4ddf6cdae2747df9af6dca1 Mon Sep 17 00:00:00 2001 From: pluja Date: Thu, 1 Oct 2020 11:58:17 +0200 Subject: [PATCH] Fixes error that prevented caching from working --- app/routes.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/routes.py b/app/routes.py index a1010d5..b291fe0 100644 --- a/app/routes.py +++ b/app/routes.py @@ -69,12 +69,12 @@ def index(): @app.route('/twitter/') @login_required def twitter(page=0): - page = int(page) followingList = current_user.twitter_following_list() - followCount = len(followingList) - posts = [] - avatarPath = "img/avatars/1.png" form = EmptyForm() + followCount = len(followingList) + page = int(page) + avatarPath = "img/avatars/1.png" + posts = [] if page == 0: cache_file = glob.glob("app/cache/{}*".format(current_user.username)) @@ -95,7 +95,7 @@ def twitter(page=0): with open("app/cache/{}".format(cache_file), 'w') as fp: json.dump(feed, fp) - posts.extend(getFeed(followingList)) + posts.extend(feed) posts.sort(key=lambda x: datetime.datetime.strptime(x['timeStamp'], '%d/%m/%Y %H:%M:%S'), reverse=True) # Items range per page