Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #58 from willkg/jingo-monkey

Use jingo.monkey if it exists
  • Loading branch information...
commit 6b797bb7230b1f65f7c9ab34cdf71fe51621d89b 2 parents d85bcca + c0e77cc
Will Kahn-Greene willkg authored

Showing 1 changed file with 8 additions and 2 deletions. Show diff stats Hide diff stats

  1. +8 2 funfactory/monkeypatches.py
10 funfactory/monkeypatches.py
@@ -20,8 +20,14 @@ def patch():
20 20
21 21 # Monkey-patch django forms to avoid having to use Jinja2's |safe
22 22 # everywhere.
23   - import safe_django_forms
24   - safe_django_forms.monkeypatch()
  23 + try:
  24 + import jingo.monkey
  25 + jingo.monkey.patch()
  26 + except ImportError:
  27 + # If we can't import jingo.monkey, then it's an older jingo,
  28 + # so we go back to the old ways.
  29 + import safe_django_forms
  30 + safe_django_forms.monkeypatch()
25 31
26 32 # Monkey-patch Django's csrf_protect decorator to use session-based CSRF
27 33 # tokens:

0 comments on commit 6b797bb

Please sign in to comment.
Something went wrong with that request. Please try again.