Sfoglia il codice sorgente

BugFix: view adaption to new page class

master
Dirk Alders 3 mesi fa
parent
commit
0c7063ce7b
1 ha cambiato i file con 8 aggiunte e 4 eliminazioni
  1. 8
    4
      pages/views.py

+ 8
- 4
pages/views.py Vedi File

@@ -15,7 +15,11 @@ import mycreole
15 15
 from .page import creol_page
16 16
 from themes import Context
17 17
 
18
-logger = logging.getLogger(__name__)
18
+try:
19
+    from config import APP_NAME as ROOT_LOGGER_NAME
20
+except ImportError:
21
+    ROOT_LOGGER_NAME = 'root'
22
+logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__)
19 23
 
20 24
 # TODO: /!\ Deactivate self registration
21 25
 # TODO: /!\ Remove config and add config_example with data from mm_tmux /!\
@@ -28,9 +32,9 @@ def root(request):
28 32
 def page(request, rel_path):
29 33
     context = Context(request)      # needs to be executed first because of time mesurement
30 34
     #
31
-    p = creol_page(rel_path)
35
+    p = creol_page(request, rel_path)
32 36
     if access.read_page(request, rel_path):
33
-        page_content = p.render_to_html(request)
37
+        page_content = p.render_to_html()
34 38
     else:
35 39
         messages.permission_denied_msg_page(request, rel_path)
36 40
         page_content = ""
@@ -50,7 +54,7 @@ def edit(request, rel_path):
50 54
     if access.write_page(request, rel_path):
51 55
         context = Context(request)      # needs to be executed first because of time mesurement
52 56
         #
53
-        p = creol_page(rel_path)
57
+        p = creol_page(request, rel_path)
54 58
         #
55 59
         if not request.POST:
56 60
             form = EditForm(page_data=p.raw_page_src)

Loading…
Annulla
Salva