From db34e0c6806c56c889384ce88509f41d66ec938f Mon Sep 17 00:00:00 2001
From: Elke Kreim <elke.kreim@hs-hannover.de>
Date: Wed, 14 Feb 2018 13:18:01 +0100
Subject: [PATCH] Create static assets folder for apps that have no local
 assets folder

---
 hshassets/utils.py | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/hshassets/utils.py b/hshassets/utils.py
index aa0d1644..18cf4114 100644
--- a/hshassets/utils.py
+++ b/hshassets/utils.py
@@ -16,6 +16,7 @@ def get_asset_directories():
     """get every app path that contains an "asset" folder on its root"""
 
     asset_apps = {}
+    all_apps = {}
 
     for app_name in settings.INSTALLED_APPS:
         app_module = import_module(app_name)
@@ -31,8 +32,17 @@ def get_asset_directories():
                 }
             })
 
+        all_apps.update({
+            app_name: {
+                'app_path': app_path,
+                'static_base_path': app_path + '/static/',
+                'static_path': app_path + '/static/' + app_name,
+                'asset_path': app_path + '/assets'
+            }
+        })
+
     for source_app, target_app in STATIC_TARGET_APPS.items():
-        asset_apps[source_app]['static_path'] = asset_apps[target_app]['static_base_path'] + source_app
+        asset_apps[source_app]['static_path'] = all_apps[target_app]['static_base_path'] + source_app
 
     return asset_apps
 
-- 
GitLab