Selaa lähdekoodia

Bugfix on multisite dyncode generation

The handled sites groups were not read from settings
Yann Weber 7 vuotta sitten
vanhempi
commit
71213ef58e
2 muutettua tiedostoa jossa 9 lisäystä ja 5 poistoa
  1. 5
    5
      lodel/bootstrap.py
  2. 4
    0
      lodel/plugin/core_scripts.py

+ 5
- 5
lodel/bootstrap.py Näytä tiedosto

@@ -208,6 +208,11 @@ def site_load(data_path):
208 208
     #WARNING !!!! Hardcoded interface name ! Here we have to find the 
209 209
     #interface plugin name in order to populate the cache properly
210 210
     app = LodelContext.module('lodel.plugins.webui.run')
211
+    #a dirty & quick attempt to fix context unwanted exite via
212
+    #hooks
213
+    for name in ( 'Plugin', 'LodelHook', 'logger', 'core_hooks',
214
+           'core_scripts'):
215
+        del(globals()[name])
211 216
     #HAS TO be populated in __loader__ context
212 217
     LodelContext.set(None)
213 218
     LodelContext.expose_modules(globals(), {
@@ -217,11 +222,6 @@ def site_load(data_path):
217 222
     #dyncode
218 223
     LodelContext.set(ctx_name)
219 224
     dyncode_bootstraping()
220
-    #a dirty & quick attempt to fix context unwanted exite via
221
-    #hooks
222
-    for name in ( 'Plugin', 'LodelHook', 'logger', 'core_hooks',
223
-           'core_scripts'):
224
-        del(globals()[name])
225 225
     #site fully loaded, switching back to loader context
226 226
     LodelContext.set(None)
227 227
 

+ 4
- 0
lodel/plugin/core_scripts.py Näytä tiedosto

@@ -376,8 +376,10 @@ class RefreshDyncode(LodelScript):
376 376
                     dyncode_path = os.path.join(
377 377
                         os.path.join(lodlesites_path, sitename),
378 378
                         'leapi_dyncode.py') #BOO hardcoded dyncode file name
379
+                    LodelContext.set(sitename)
379 380
                     cls.refresh_dyncode(emfile_path, dyncode_path,
380 381
                         em_translator)
382
+                    LodelContext.set(None)
381 383
         #Refresh only one dyncode
382 384
         #if multisite it's the lodelsites dyncode
383 385
         LodelContext.set(None)
@@ -385,6 +387,8 @@ class RefreshDyncode(LodelScript):
385 387
 
386 388
     
387 389
     ##@brief Refresh dyncode
390
+    #@warning you HAVE TO be in handled site context (in order to fetch groups
391
+    #from conf)
388 392
     #@param model_file str : EM filename
389 393
     #@param dyncode_file str : dyncode output filename
390 394
     #@param em_translator str : translator name

Loading…
Peruuta
Tallenna