From c60b3ade8229e149e8b76f572df54eb9419686f6 Mon Sep 17 00:00:00 2001 From: pluja Date: Tue, 6 Oct 2020 19:13:04 +0200 Subject: [PATCH] Fixes tweet reply user profile links When a user quoted another, the quoted user profile link was broken --- app/routes.py | 5 ++++- app/templates/_twitter_post.html | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/routes.py b/app/routes.py index 6d9a38a..42106d6 100644 --- a/app/routes.py +++ b/app/routes.py @@ -819,7 +819,10 @@ def getFeed(urls): if quote.find('div', attrs={'class':'unavailable-quote'}): newPost["replyingUser"]="Unavailable" else: - newPost["replyingUser"]=quote.find('a', attrs={'class':'username'}).text + try: + newPost["replyingUser"]=quote.find('a', attrs={'class':'username'}).text + except: + newPost["replyingUser"]="Unavailable" post.find('div', attrs={'class':'quote'}).decompose() if post.find('div', attrs={'class':'attachments'}): diff --git a/app/templates/_twitter_post.html b/app/templates/_twitter_post.html index 09cc99e..cba6368 100644 --- a/app/templates/_twitter_post.html +++ b/app/templates/_twitter_post.html @@ -29,7 +29,7 @@ {% if post.isReply %}
- +
{{post.replyingUser}}
{{post.replyingTweetContent | safe}}