Skip to content

Commit

Permalink
fix fetch content logic
Browse files Browse the repository at this point in the history
  • Loading branch information
facundoolano committed Jan 2, 2024
1 parent b99ca9f commit 2c21188
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 1 addition & 2 deletions feedi/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,9 +549,8 @@ def fetch_content(self):
try:
self.content_full = scraping.extract(self.content_url)['content']
db.session.commit()
return True
except Exception:
return False
pass

@classmethod
def _filtered_query(cls, user_id, hide_seen=False, favorited=None,
Expand Down
3 changes: 2 additions & 1 deletion feedi/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,8 @@ def entry_view(id):
return redirect_response(entry.target_url)

# if full browser load or explicit content request, fetch the article synchronously
if entry.fetch_content():
entry.fetch_content()
if entry.content_full:
return flask.render_template("entry_content.html", entry=entry, content=entry.content_full)

return redirect_response(entry.target_url)
Expand Down

0 comments on commit 2c21188

Please sign in to comment.