Browse Source

Make sure relevant metadata exists for tweets

merge-requests/37/head
Deimos 6 years ago
parent
commit
086c3facd9
  1. 4
      tildes/tildes/models/topic/topic.py

4
tildes/tildes/models/topic/topic.py

@ -419,6 +419,8 @@ class Topic(DatabaseModel):
if self.link and is_tweet(self.link):
authors = self.get_content_metadata("authors")
tweet = self.get_content_metadata("description")
return f"<cite>@{authors[0]}:</cite><blockquote>{tweet}</blockquote>"
if authors and tweet:
return f"<cite>@{authors[0]}:</cite><blockquote>{tweet}</blockquote>"
return None
Loading…
Cancel
Save