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):
article.upvote(by)
# 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()
return article
......
......@@ -15,5 +15,5 @@ url
coreapi
pygments
markdown
opengraph-py3
opengraph_py3
-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