Commit b56b812d authored by Okhin's avatar Okhin

Let's manage errors if they happens on OpenGraph stuff

parent 9041d877
...@@ -185,7 +185,12 @@ class Article(VoteMixin): ...@@ -185,7 +185,12 @@ class Article(VoteMixin):
article.upvote(by) article.upvote(by)
# Let's get metadata import # Let's get metadata import
article.metadata = og.OpenGraph(url=url) try:
metadata = og.OpenGraph(url=url.decode())
article.metadata = metadata.to_json()
except Exception:
# There's nothing behind the URL, so no metadata for us
pass
article.save() article.save()
return article return article
......
...@@ -15,5 +15,5 @@ url ...@@ -15,5 +15,5 @@ url
coreapi coreapi
pygments pygments
markdown markdown
opengraph-py3 opengraph_py3
-e git+https://github.com/mariocesar/sorl-thumbnail.git#egg=sorl-thumbnail -e git+https://github.com/mariocesar/sorl-thumbnail.git#egg=sorl-thumbnail
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment