Skip to content

Commit

Permalink
move asset overrides to an earlier phase
Browse files Browse the repository at this point in the history
  • Loading branch information
mmerickel committed Dec 16, 2016
1 parent 1a7242b commit 1d78284
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/narr/extconfig.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
8 changes: 6 additions & 2 deletions pyramid/config/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

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
Expand Down Expand Up @@ -387,6 +390,7 @@ def register():
)
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

0 comments on commit 1d78284

Please sign in to comment.