Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Added functools.wraps #2

Merged
merged 1 commit into from

2 participants

@martriay

While using this useful decorator I've found that all request matched the last jsonified route in the app, this is why I wrapped the decorator with http://docs.python.org/2/library/functools.html#functools.wraps

@fredj fredj merged commit 0b2e892 into from
@fredj
Owner

Thanks @martriay. FYI: I'm not developing this code anymore ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 0 deletions.
  1. +2 −0  flaskext/jsonify.py
View
2  flaskext/jsonify.py
@@ -5,8 +5,10 @@
from simplejson import dumps
from flask import Response
+from functools import wraps
def jsonify(f):
+ @wraps(f)
def inner(*args, **kwargs):
return Response(dumps(f(*args, **kwargs)), mimetype='application/json')
return inner
Something went wrong with that request. Please try again.