Browse files

Pull data from request.form if not present in the request body (jquery

fix)
  • Loading branch information...
1 parent 0a93cd0 commit 57cc2fccd96641c82e4bb56ee398630df0f833e2 @coleifer committed Apr 3, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 flask_peewee/rest.py
View
3 flask_peewee/rest.py
@@ -329,8 +329,9 @@ def create(self):
return self.response(self.serialize_object(instance))
def edit(self, obj):
+ data = request.data or request.form.get('data') or ''
try:
- data = json.loads(request.data)
+ data = json.loads(data)
except ValueError:
return self.response_bad_request()

0 comments on commit 57cc2fc

Please sign in to comment.