diff options
| author | Michael Merickel <michael@merickel.org> | 2016-12-16 00:15:46 -0600 |
|---|---|---|
| committer | Michael Merickel <michael@merickel.org> | 2016-12-16 00:17:00 -0600 |
| commit | 1d78284a59718b02df1e05ee24f9ed2485f51cbb (patch) | |
| tree | b63756b84cd005e26f641a294612b03c80fa6872 | |
| parent | 1a7242be0fc543fd8a965cbc02022941cdadabcc (diff) | |
| download | pyramid-1d78284a59718b02df1e05ee24f9ed2485f51cbb.tar.gz pyramid-1d78284a59718b02df1e05ee24f9ed2485f51cbb.tar.bz2 pyramid-1d78284a59718b02df1e05ee24f9ed2485f51cbb.zip | |
move asset overrides to an earlier phase
| -rw-r--r-- | docs/narr/extconfig.rst | 1 | ||||
| -rw-r--r-- | pyramid/config/assets.py | 8 |
2 files changed, 7 insertions, 2 deletions
diff --git a/docs/narr/extconfig.rst b/docs/narr/extconfig.rst index babfa0a98..4009ec1dc 100644 --- a/docs/narr/extconfig.rst +++ b/docs/narr/extconfig.rst @@ -260,6 +260,7 @@ Pre-defined Phases - :meth:`pyramid.config.Configurator.add_subscriber_predicate` - :meth:`pyramid.config.Configurator.add_view_predicate` - :meth:`pyramid.config.Configurator.add_view_deriver` +- :meth:`pyramid.config.Configurator.override_asset` - :meth:`pyramid.config.Configurator.set_authorization_policy` - :meth:`pyramid.config.Configurator.set_default_csrf_options` - :meth:`pyramid.config.Configurator.set_default_permission` diff --git a/pyramid/config/assets.py b/pyramid/config/assets.py index d05314384..6eafc1eb1 100644 --- a/pyramid/config/assets.py +++ b/pyramid/config/assets.py @@ -4,7 +4,10 @@ import sys from zope.interface import implementer -from pyramid.interfaces import IPackageOverrides +from pyramid.interfaces import ( + IPackageOverrides, + PHASE1_CONFIG, +) from pyramid.exceptions import ConfigurationError from pyramid.threadlocal import get_current_registry @@ -387,6 +390,7 @@ class AssetsConfiguratorMixin(object): ) intr['to_override'] = to_override intr['override_with'] = override_with - self.action(None, register, introspectables=(intr,)) + self.action(None, register, introspectables=(intr,), + order=PHASE1_CONFIG) override_resource = override_asset # bw compat |
