Browse Source

Small bugfix & enhancement

Yann Weber 7 years ago
parent
commit
3e3b4740da
2 changed files with 4 additions and 2 deletions
  1. 2
    1
      lodel/context.py
  2. 2
    1
      lodel/plugins/multisite/loader_utils.py

+ 2
- 1
lodel/context.py View File

91
                 fd.close()
91
                 fd.close()
92
             lodel_pkg_path = os.path.join(mod_path, 'lodel')
92
             lodel_pkg_path = os.path.join(mod_path, 'lodel')
93
             if not os.path.exists(lodel_pkg_path):
93
             if not os.path.exists(lodel_pkg_path):
94
-                os.symlink(lodel.__path__[0], lodel_pkg_path, True)
94
+                os.symlink(src = lodel.__path__[0], dst = lodel_pkg_path,
95
+		    target_is_directory = True)
95
             #Cache invalidation after we "created" the new package
96
             #Cache invalidation after we "created" the new package
96
             #importlib.invalidate_caches()
97
             #importlib.invalidate_caches()
97
         return None
98
         return None

+ 2
- 1
lodel/plugins/multisite/loader_utils.py View File

86
             datapath = os.path.join(lodelsites_datapath, handled_sitename)
86
             datapath = os.path.join(lodelsites_datapath, handled_sitename)
87
             try:
87
             try:
88
                 site_load(datapath) #using default conf.d configuration dirname
88
                 site_load(datapath) #using default conf.d configuration dirname
89
-            except LodelFatalError as e:
89
+            except Exception as e:
90
+                LodelContext.set(None)
90
                 LodelContext.set(lodelsites_name)
91
                 LodelContext.set(lodelsites_name)
91
                 LodelContext.expose_modules(globals(), {
92
                 LodelContext.expose_modules(globals(), {
92
                     'lodel.settings': ['Settings'],
93
                     'lodel.settings': ['Settings'],

Loading…
Cancel
Save