MongoEngine/flask-mongoengine — pull request #10 by joeshaw (2012-08-27 18:22:04+00:00)
Title: only patch jinja_env.loader once to include mongoengine templates

At least with flask-debugtoolbar 0.6.x, which supports the latest Flask,
a DebugPanel instance is created on each request. The flask-mongoengine
panels were patching the jinja environment's loader every time an instance
was created. Given enough times, this will cause a RuntimeError with
maximum recursion depth being reached. Fix this by only patching the
loader once, the first time it's needed.