0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 03:31:04 +01:00

Fix embedly key referenced before assignment

This commit is contained in:
Tom Talbot 2014-06-11 10:46:29 +01:00
parent 77c75efcf2
commit 9d98eeefb8

View File

@ -45,13 +45,14 @@ def import_string(dotted_path):
def embedly(url, max_width=None, key=None):
from embedly import Embedly
# Get embedly client
client = Embedly(key=key)
# Get embedly key
if key is None:
key = settings.EMBEDLY_KEY
# Get embedly client
client = Embedly(key=key)
# Call embedly
if max_width is not None:
oembed = client.oembed(url, maxwidth=max_width, better=False)