Skip to content

Commit

Permalink
Backward support for Flask < 0.10 #82
Browse files Browse the repository at this point in the history
  • Loading branch information
lepture committed Aug 18, 2013
1 parent b2070a4 commit 6dea39d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions flask_wtf/recaptcha/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

from flask import current_app, Markup
from werkzeug import url_encode
from flask.json import dumps, JSONEncoder
from flask import json
from .._compat import text_type
JSONEncoder = json.JSONEncoder

try:
from speaklater import _LazyString
Expand Down Expand Up @@ -42,7 +43,7 @@ def recaptcha_html(self, server, query, options):
return Markup(html % dict(
script_url='%schallenge?%s' % (server, query),
frame_url='%snoscript?%s' % (server, query),
options=dumps(options, cls=_JSONEncoder)
options=json.dumps(options, cls=_JSONEncoder)
))

def __call__(self, field, error=None, **kwargs):
Expand Down
4 changes: 2 additions & 2 deletions tests/base.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from __future__ import with_statement

from speaklater import _LazyString
from flask.json import JSONEncoder
from flask import Flask, render_template, jsonify
from flask import Flask, render_template, json, jsonify
from wtforms import TextField, HiddenField, SubmitField
from wtforms.validators import DataRequired
from flask_wtf import Form
from flask_wtf._compat import text_type
JSONEncoder = json.JSONEncoder


def to_unicode(text):
Expand Down

0 comments on commit 6dea39d

Please sign in to comment.