Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ftd_django/src/ftd_django/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def render(self, context=None, request=None):
self.template,
root=FPM_FOLDER,
base_url=BASE,
handle_processor=helpers.processor,
handle_processor=helpers.processor(request),
**context,
)

Expand Down
12 changes: 7 additions & 5 deletions ftd_django/src/ftd_django/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,12 @@ def initialize_processors(processors: List[str]):
PROCESSORS[p.processor_name] = p


def processor(doc_id, section, interpreter):
def processor(request):
def p(doc_id, section, interpreter):

name = section.header_string(doc_id, "$processor$")
if name in PROCESSORS:
return PROCESSORS[name](doc_id, section, interpreter)
name = section.header_string(doc_id, "$processor$")
if name in PROCESSORS:
return PROCESSORS[name](request, doc_id, section, interpreter)

raise Exception(f"{name}: unknown processor")
raise Exception(f"{name}: unknown processor")
return p