kopia lustrzana https://github.com/wagtail/wagtail
Merge pull request #1799 from anurag-ks/master
commit
6495bb6736
|
@ -14,6 +14,7 @@ Changelog
|
|||
* page_published signal now called with the revision object that was published (Josh Barr)
|
||||
* Added an overrideable favicon to the admin interface
|
||||
* Added spinner animations to long-running form submissions
|
||||
* The EMBEDLY_KEY setting has been renamed to WAGTAILEMBEDS_EMBEDLY_KEY (Anurag Sharma)
|
||||
* Fix: Deleting a page permission from the groups admin UI does not immediately submit the form
|
||||
* Fix: Wagtail userbar is shown on pages that do not pass a `page` variable to the template (e.g. because they override the `serve` method)
|
||||
* Fix: request.site now set correctly on page preview when the page is not in the default site
|
||||
|
|
|
@ -66,6 +66,7 @@ Contributors
|
|||
* Michael Cordover
|
||||
* Timothy Allen
|
||||
* Rob Shelton
|
||||
* Anurag Sharma
|
||||
|
||||
|
||||
Translators
|
||||
|
|
|
@ -184,7 +184,7 @@ Use a custom embed finder function, which takes a URL and returns a dict with me
|
|||
.. code-block:: python
|
||||
|
||||
# not a working key, get your own!
|
||||
EMBEDLY_KEY = '253e433d59dc4d2xa266e9e0de0cb830'
|
||||
WAGTAILEMBEDS_EMBEDLY_KEY = '253e433d59dc4d2xa266e9e0de0cb830'
|
||||
|
||||
Providing an API key for the Embedly service will use that as a embed backend, with a more extensive list of providers, as well as analytics and other features. For more information, see `Embedly`_.
|
||||
|
||||
|
@ -515,7 +515,7 @@ These two files should reside in your project directory (``myproject/myproject/`
|
|||
|
||||
# If you want to use Embedly for embeds, supply a key
|
||||
# (this key doesn't work, get your own!)
|
||||
# EMBEDLY_KEY = '253e433d59dc4d2xa266e9e0de0cb830'
|
||||
# WAGTAILEMBEDS_EMBEDLY_KEY = '253e433d59dc4d2xa266e9e0de0cb830'
|
||||
|
||||
|
||||
``urls.py``
|
||||
|
|
|
@ -37,6 +37,7 @@ Minor features
|
|||
* page_published signal now called with the revision object that was published
|
||||
* Added a favicon to the admin interface, customisable by overriding the ``branding_favicon`` block (see :ref:`custom_branding`).
|
||||
* Added spinner animations to long-running form submissions
|
||||
* The EMBEDLY_KEY setting has been renamed to WAGTAILEMBEDS_EMBEDLY_KEY
|
||||
|
||||
Bug fixes
|
||||
~~~~~~~~~
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
from datetime import datetime
|
||||
import json
|
||||
import warnings
|
||||
|
||||
# Needs to be imported like this to allow @patch to work in tests
|
||||
from django.utils.six.moves.urllib import request as urllib_request
|
||||
|
@ -11,6 +12,7 @@ from django.conf import settings
|
|||
|
||||
from wagtail.wagtailembeds.oembed_providers import get_oembed_provider
|
||||
from wagtail.wagtailembeds.models import Embed
|
||||
from wagtail.utils.deprecation import RemovedInWagtail14Warning
|
||||
|
||||
|
||||
class EmbedException(Exception):
|
||||
|
@ -31,7 +33,13 @@ def embedly(url, max_width=None, key=None):
|
|||
|
||||
# Get embedly key
|
||||
if key is None:
|
||||
key = settings.EMBEDLY_KEY
|
||||
try:
|
||||
key = settings.WAGTAILEMBEDS_EMBEDLY_KEY
|
||||
except AttributeError:
|
||||
key = settings.EMBEDLY_KEY
|
||||
warnings.warn(
|
||||
"EMBEDLY_KEY is now deprecated. Use WAGTAILEMBEDS_EMBEDLY_KEY instead",
|
||||
RemovedInWagtail14Warning)
|
||||
|
||||
# Get embedly client
|
||||
client = Embedly(key=key)
|
||||
|
@ -115,7 +123,7 @@ def get_default_finder():
|
|||
return import_string(settings.WAGTAILEMBEDS_EMBED_FINDER)
|
||||
|
||||
# Use embedly if the embedly key is set
|
||||
if hasattr(settings, 'EMBEDLY_KEY'):
|
||||
if hasattr(settings, 'WAGTAILEMBEDS_EMBEDLY_KEY') or hasattr(settings, 'EMBEDLY_KEY')::
|
||||
return embedly
|
||||
|
||||
# Fall back to oembed
|
||||
|
|
Ładowanie…
Reference in New Issue