Skip to content

Commit

Permalink
Fix static path check
Browse files Browse the repository at this point in the history
  • Loading branch information
n0phx committed Oct 30, 2015
1 parent 8a9e5db commit 0c8b9a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions librarian_core/contrib/assets/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ def component_member_loaded(supervisor, member, config):
supervisor.config.setdefault('assets.css_bundles', [])
pkg_name = member['pkg_name']
if pkg_name not in supervisor.config['assets.sources']:
static_path = config.pop('assets.directory', DEFAULT_STATIC_ROOT)
static_dir = config.pop('assets.directory', DEFAULT_STATIC_ROOT)
static_path = os.path.join(member['pkg_path'], static_dir)
static_url = config.pop('assets.url', DEFAULT_STATIC_URL)
js_bundles = config.pop('assets.js_bundles', [])
css_bundles = config.pop('assets.css_bundles', [])
if static_path and os.path.exists(static_path):
static_path = os.path.join(member['pkg_path'], static_path)
src_pair = (static_path, static_url)
supervisor.config['assets.sources'][pkg_name] = src_pair
supervisor.config['assets.js_bundles'].extend(js_bundles)
Expand Down

0 comments on commit 0c8b9a6

Please sign in to comment.