1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ihatemoney_ynh.git synced 2024-09-03 19:26:15 +02:00

API: set the mimetype on the response

This commit is contained in:
Alexis Metaireau 2011-09-13 19:24:48 +02:00
parent e13ceaf351
commit 8528526f0b
2 changed files with 4 additions and 1 deletions

View file

@ -64,6 +64,8 @@ class MemberHandler(object):
def delete(self, project, member_id):
if project.remove_member(member_id):
return Response('OK', status=200)
else:
return Response('Not Found', status=404)
class BillHandler(object):

View file

@ -133,7 +133,8 @@ def serialize(func):
return data
else:
# serialize it
return SERIALIZERS.get(mime, "text/json").encode(data)
return werkzeug.Response(SERIALIZERS[mime].encode(data),
status=200, mimetype=mime)
return wrapped