Skip to content

Commit 1068c4e

Browse files
committed
refs #80, Add the python3 support when loading context dynamically
1 parent e2b9412 commit 1068c4e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

formidable/accesses.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ def get_accesses():
4646

4747
def get_context(request, kwargs):
4848
module, meth_name = settings.FORMIDABLE_CONTEXT_LOADER.rsplit('.', 1)
49-
mod = importlib.import_module(module, [meth_name])
49+
if six.PY3:
50+
mod = importlib.import_module(module)
51+
else:
52+
mod = importlib.import_module(module, [meth_name])
5053
meth = getattr(mod, meth_name)
5154
return meth(request, kwargs)

0 commit comments

Comments
 (0)